Sales Order Country of Delivery
AnsweredI'm trying to set up a validation that adds Freight charges to a sales order - but I need a different freight charge value depending on the destination country (and order value but I can deal with that).
If I look at the system information on the delivery address , it all seems to be a single field. If I click through "Set Address Components" I can see each field in the address, the country is on $[$10000003.10000019.0], but using this gives me an error:
Macro error in UF-048: System.Exception: Could not find Item with UID: "10000003" on Form: 139 (Sales Order)
-
Official comment
Hello Keith,
The problem is that the field is included in another window, not the Sales order directly.

What you can do is to obtain the country using an SQL Query that obtains the information based on the customer and the Address name.
-
Thank you,
Yes, this is the issue I've come up against - even if I get the Macro to open that window I can't read the information.
I'll have to go down the SQL route you mention, which will work as long as the address isn't manually entered.
-
Try this:
If the address has been manually entered using the builder button you should be able to query the correct country using:
Table: RDR12
Field: CountryS for the Ship to Country
Note: If you make the Address2 field on the Sales Order read only then the user has to use the builder button to modify the address thereby filling in Table RDR12
-
Thanks for the input. I didn't mention it in my initial post, but I'm doing this as part of a validation, so the order won't be present in the data table.
In the end I went with looking at the country value of the address associated with the ship to code. I added a popup message when the ship to code is blank, to tell the user to manually enter the freight. (It could be handy if the macro system could take user input from a message box?)
Actually thinking further, if I change the validation trigger from "Before Action = TRUE" to FALSE in the validation configuration would I be able to see the order in the database? Or do I then loose the ability to send it to a line loop and have a macro add/update a line?
-
If you want to check this value before the record is added then try the following syntax:
$[RDR12.CountryS] to refer to the "Active Record" data.
To test I usually add a temporary button to the form calling a messagebox to display the value (simple and easy to make changes )
-
Hi Geoff,
That's exactly what I wanted, thank you!
Please sign in to leave a comment.
Comments
6 comments