Page 1 of 1

Customer delivery addresses

Posted: Wed Apr 12, 2006 11:59 am
by Nat
How would I setup my customer screen using the screen builder to copy the customer's address into the customer's delivery address automatically, if the delivery address is not filled in by the operator?

Posted: Wed Apr 12, 2006 12:02 pm
by COBS Tech Support
Here is a script that copies the customer address to the delivery address. Add this to the bottom of the Screen Script inside the Screen Builder, when the customer screen is open.

If Mode = 3
If IsEmpty(SCRRead("CUSDNAME") + SCRRead("CUSDADD") + SCRRead("CUSDADD2") + SCRRead("CUSDSUB"))
SCRWrite("CUSDNAME", SCRRead("CUSNAME"))
SCRWrite("CUSDADD", SCRRead("CUSADDR"))
SCRWrite("CUSDADD2", SCRRead("CUSADDR2"))
SCRWrite("CUSDSUB", SCRRead("CUSSUB"))
SCRWrite("CUSDPOST", SCRRead("CUSPOST"))
SCRWrite("CUSDSTATE", SCRRead("CUSSTATE"))
Endif
Endif

The above script checks to see if the delivery name + delivery address + 1st and 2nd address lines + the delivery suburb are blank.

If all these fields are blank, the customer address is copied into the delivery address. Otherwise it's left untouched. Obviously this can be changed to suite the requirements of the business.