Address Book

The address book is used as a way to pre-fill an address form from an existing address, without the user having to type it from scratch. Because Limio for Salesforce is only aware of addresses stored in Limio, this is the list that by default the flow retrieves.

The apex action Get Customer Addresses returns a list of addresses from the customer record in Limio, and stores the output in the flow variable CustomerAddresses.

Screenshot_2022-06-21_at_09.28.34.png

This step can be customised by passing additional addresses from other records in the org, for a more tailored experience based on the org setup. The output generated must be a

List<i42as.CustomerAddress>

where i42as is the namespace for Limio for Salesforce. The CustomerAddress apex class is a global class with the following properties

Screenshot 2023-10-23 at 12.46.30.png

Learn more about the class here:

Below is an example that returns an address book entry from the billing address fields on the account

List<i42as.CustomerAddress> addressToReturn = new List<i42as.CustomerAddress>(); List accounts = [SELECT FirstName, LastName, BillingCity, BillingCountry, BillingPostalCode, BillingState, BillingStreet, BillingBuildingNumber, BillingStreetName FROM Account WHERE Id=: caseRecord.AccountId LIMIT 1]; if (accounts.size() > 0) { i42as.CustomerAddress address = new i42as.CustomerAddress(); address.FirstName = accounts[0].FirstName; address.LastName = accounts[0].FirstName; address.MailingStreet = accounts[0].BillingStreet; address.MailingCity = accounts[0].BillingCity; address.MailingPostalCode = accounts[0].BillingPostalCode; address.MailingState = accounts[0].BillingState; address.MailingCountry = accounts[0].BillingCountry; address.id = 'billingaddressid'; address.label = accounts[0].BillingStreet + ' ' + accounts[0].BillingCity + ' ' +accounts[0].BillingPostalCode; addressToReturn.add(address);

// building number and street name can be mapped from your custom field: address.MailingBuildingNumber = accounts[0].customBillingBuildingNumber; address.MailingStreetName = account[0].customBillingStreetName; }

The generated output can be stored on the CustomerAddresses variable of the flow, that is of the same type.

Screenshot_2022-06-21_at_09.55.42.png

This variable can then be passed to components that use an address book, like the delivery address book or the payment method iframe.

Screenshot_at_Jun_21_09-54-48.png

Last updated

Was this helpful?