Skip to main content

Sales Order Country of Delivery

Answered

Comments

6 comments

  • Official comment
    Yaremi Miranda Lopez

    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.

  • Keith Beall

    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.

  • Geoff Booth

    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

  • Keith Beall

    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?

  • Geoff Booth

    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 )

  • Keith Beall

    Hi Geoff,

     

    That's exactly what I wanted, thank you!

Please sign in to leave a comment.