Jump to content
Server Maintenance This Week. ×

Copy Customer Address

This topic is 2762 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi All - I have a customers layout with two tabs, one is for the customer address and the other tab has the billing address. I want to have a check box with a label that says "Is Billing address the same as Customer Address?", that when ticked copies data from the customer address fields to information, as an example the CustomerStreetName field would be copied to BillingStreetName field. 

Could someone give me a basic example of how this might look please?



Link to comment
Share on other sites

IMHO, if you have a checkbox field indicating that Billing address is the same as Customer address, then you already know that they are the same and there is no need to duplicate the data. On the contrary, the Billing address fields should be validated as empty. Otherwise you may end up with a contradiction, where the checkbox is checked and the data does not match.

Link to comment
Share on other sites

You can use an OnObjectModify script trigger to do the following:

If [not isempty(Table::CheckboxField)] //Check box field contains a value, proceed, otherwise exit script
     Set Variable [$Addr; Value:Customers::CustStreetName]   
     Set Variable [$City; Value:Customers::CustCity]   
     Set Variable [$State; Value:Customers::CustState]   
     Set Variable [$Zip; Value:Customers::CustZip]   
     Set Field [Customer::BillStreet; Value:$Addr]   
     Set Field [Customer::BillCity; Value:$City]   
     Set Field [Customer::BillState; Value:$State]   
     Set Field [Customer::BillZip; Value:$Zip]
End If

Edit:  Note Comment's comment about if the billing address fields already contain a value

Edited by Steve Martino
Link to comment
Share on other sites

This topic is 2762 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.