by coldrick » Sun May 04, 2008 5:24 pm
FYI Solution to this problem is as follows. The last bit of code is an extra add-on which copies the billing address details to the delivery address details if the delivery address is left blank (unrelated to the problem above).
CUSCODE set to show for all security levels in Screen Builder
In CUSTOMER.MAC...
If .NOT. Security(8,FALSE)
SCRHide("CUSCODE")
Endif
* Detect adding a customer
If SCRMode() == 1
SCRShow("CUSCODE")
Endif
* Detect save event
If Mode == 3
* We want freight prompt off permanently
SCRWrite("CUSFREIASK", 'N')
* We want terms set to 0 if Credit is $0.00
If SCRRead("CUSCREDIT") = 0
SCRWrite("CUSTERMS",0)
Endif
* Add billing details to delivery details if delivery is blank
If Empty(SCRRead("CUSDNAME"))
SCRWrite("CUSDNAME", SCRRead("CUSNAME"))
SCRWrite("CUSDADD", SCRRead("CUSADDR"))
SCRWrite("CUSDADD2", SCRRead("CUSADDR2"))
SCRWrite("CUSDSUB", SCRRead("CUSSUB"))
SCRWrite("CUSDSTATE", SCRRead("CUSSTATE"))
SCRWrite("CUSDPOST", SCRRead("CUSPOST"))
SCRWrite("DELCOUNTRY", SCRRead("CUSCOUNTRY"))
EndIf
* Set default to eParcel if no carrier entered
If Empty(SCRRead("CUSCARRIER"))
SCRWrite("CUSCARRIER", 'EPARCELSTD')
Endif
Return True
Endif