Integration by New Database Record - Receiving PO
If anyone has a method of doing any these please share some of the methods you used.
USING: BT2016 Automated with MS SQL Database running P21 (Epicor) Planning to use Integration Builder.
When staff receive a PO, table {p21_poreceiving_report_view} updates with a new record in field [date_created]. Using Integration Builder/New Record Detection this prints a label which looks at that same table and puts a sort order descending on that field so record 1 is all ways the last item received. Database links pull the data needed to the label.
How would you best control how many labels to print and change the label quantity? Say I have 3,216 parts - 6 bags at 500 and one bag at 216.
I tried setting up a serialized label where the user entered full bag quantity (500) and the total label count (Full + Partial = 7) with a non-print prompt named objects which used label count to set Format.NumberSerializedLabels. I could use a counter script in Event Control Scripts/ OnSerialize to count down and recognize the last label to make it the partial and print the modulus of the [unit_quantity]/user_input_full_bag_qty.
All this worked fine when printing statically from Print Station, would not prompt user during Integration Builder testing. Starting the test also gave an error on opening the format "Serialize cannot be less than one". That was about the point I came here. Prints fine manually.
What is a good way of identifying what identical copy is printing (need a handle)? Where can you place a counter varible you could set to counter = counter -1 when you only have 6 identical labels printing you can tell 1 from 6?
Is injecting the count of labels to print and full quantities and partial quantities into the label with the Integration Builder better/easier? Perhaps prompting the user from the service?
And I don't understand how with a deployed integration does it know which user to prompt when needed? Is it because the Automation version is local to a single machine? Can I run Automation on each machine as individuals?
Maybe I don't have the correct angle of looking at this yet from lack of experience.
-
Peter Thane
★ BarTender Hero ★
Hi Terry,
Yes you can run integrations on individual machines, I have just had to deploy one like this where I need to use dedicated printers for different computers/users but the printer names are not linked to the ERP system and so this coold not be supplied as a variable in the trigger file.
You could try
1. Add a VB Event Controlled Field to the side of the label and give it a name and set it to OnNewRecord that divides the total number by the number per bag and always rounds up (the simplest way I could think of doing this was multiplying the result of the division by -1 then using the Int command and multiply it back again by -1).
2. Then add a second text field (which will be a label count in reverse), again given a name for ease and set to serialise and decrement wist a reset after Each Job. Using the Transforms VB set the value to equal the name of the field from 1 above and this will become the starting number of the field. (I called this field labelcount
)3. On the File>Print screen set the number of Serialised labels to to be set by a Data Source and link this to field in 1 again
4. For the number of items field, set this to Event Controlled VB and OnIdenticalCopies. For the value of this field use an If...Then...Else statement something like this where bagqty is the items per bag (500 in your example) whilst toteqty is the total number of items
Value = Format.NamedSubStrings("bagqty").Value
Value1 = Format.NamedSubStrings("lblcount").Value
Value2 = Format.NamedSubStrings("toteqty").ValueIf Value1 = 1 then
Value = Value2 Mod Valueelse Value = Value
end if
Value = Value
Pete
0 -
Terry Teter
★ BarTender Hero ★
Hi Pete,
Your example matches very closely with what I have done in one of my tests. Something odd happens with using the field set to Data Source Serialized, it gives an error message when running in automation. Works fine when printing statically. Even when I added code for setting the line to equal 1 then update it to the actual count, and even when I set the minimum value to at least be 1 never zero. I wish sharing formats was possible. I wondered if this was a side effect from moving the format from a test sandbox to the live environment?
0 -
Terry Teter
★ BarTender Hero ★
Hello Again Pete,
First message still pending approval so of course I have another question. How does prompting a user for more data work with your integrations? Is it reliable, ever go to the wrong person, who do you direct where it goes? Anything you can give me helps, as I am setting up my first one. Thanks!
0 -
Peter Thane
★ BarTender Hero ★
Have you tried setting the OnAutoSelected value to Value = "1" if that is not already set?
I am yet to use the "Prompt for Data Input" option, but I believe that will just open the BarTender Data Entry form on the computer where the integration is running although I am not sure what happens if specific user credentials are being used on the For Each Database Record
0 -
Terry Teter
★ BarTender Hero ★
I did get it to work once running locally on my test bench with a sandbox SQL. I shut it down at the end of the day and it never came back on. To that end, other things are now showing up that make me wonder, such as the record picker is now running so slow it is useless. It would take 1.45 seconds to change the visibility of a single column and the mouse cursor will blink very quickly from normal to busy as long as this format is open. I created a new format and the cursor was fine until I got deeper into the setup of the format and then experienced the same problem with background usage. Time to scrub the machine! When tests go wrong.
Thanks for the input. If I do ever get this running maybe I can do a synopsis of the project for others.
0 -
Peter Thane
★ BarTender Hero ★
I am in a bit of a similar boat with Integration Builder, it was working fine, then after a lovely Windows update it only works intermittently. Everything else works and the integrations work on other computers just not on mine so I need to find the time to do a full removal and reinstall of BarTender as that should resolve things
0
Please sign in to leave a comment.
Comments
6 comments