Hello, I need to figure out a way to populate multiple fields on a purchase order for delivery purposes.
We do a lot of drop shipping directly to the customer (which is fairly standard in my industry), and we need a way to have the shipping address on the PO’s so that the Supplier knows where to ship the items.
I could create a custom small text field and just type the address in manually each time I need to drop-ship and item, but that seems to be too much work for something that a little bit of scripting (or perhaps HTML formatting in the print format) should be able to automate. Essentially, I want the Purchase Orders to treat addresses similar to how the Delivery Notes do, in that the user selects one address field, and the full address is then populated into a field that is printed on the document. To be frank, I am a bit surprised to see that this doesn’t behave this way currently, but maybe my industry is just an oddity and it’s a feature that few people take advantage of.
Based on what I have read, a Fetch from Master script should do the trick, but I do not know the propper syntax to do this multiple times throughout the document:
Here are the fields I am working with:
Field 1: Address Name - Master (link to customer address)
Field 2: Address 1
Field 3: Address 2
Field 4: City
Field 5: State
Field 6: Postal Code
The script that I found in the manual is the following:
add_fetch(link_fieldname, source_fieldname, target_fieldname)
Using this as a starting point, I have managed to populate one of these fields, but I do not know the proper syntax to populate the rest of them. Also, I have a feeling that I can probably consolidate fields 2-6 into a Small Text field, but again, I would need to know the syntax for bringing all the information into it.
If anyone is willing to help, I would appreciate it.
Condensed Version: I need a way to target multiple fields with multiple sources from a single linked field by using a custom script, or another method if it is easier.