Skip to content

How do you pull an Address Line 1 and Post Code from Location Addresses onto a different entity (like a Serial Object) using only the Location ID as the key, when there's no direct field for it?

Answer

Create a read-only custom field using an Expression or Select implementation that calls Location_Party_Address_API.Get_Primary_Cust_Address1(location_id_, address_info_id_, identity_) for the address line and Location_Party_Address_API.Get_Primary_Cust_Zip_Code(location_id_, address_info_id_, identity_) for the post code — the identity_ argument can be left NULL. The main thing to plan around is that a Location can have multiple addresses, so you'll need to decide how to handle that (these two API functions already resolve to a single 'primary' address); alternatively, a Select-statement custom field querying location_party_address directly by location ID and returning the first row (rownum = 1) works if you're confident there's only ever one address per location in your data.

← Browse Developer Studio, deployment, and upgrades questions