Skip to main content
Solved

Custom Field Help: Address Line 1

  • March 6, 2023
  • 1 reply
  • 119 views

Forum|alt.badge.img+12

I want to pull the Address Line 1 and Post Code from Location Addresses into Serial Objects using the Location ID as the Key.

 

I cannot work out how best to achieve this and wondered if anyone could point me in the right direction?

Thanks,

Best answer by Technical Outlaws

You could create a read-only custom field that utilises an expression or select statement.  The only thing for you to consider is how to handle locations with multiple addresses?!

 

Utilising the methods in Location_Party_Address_API seems quite straightforward but you need to know the address_info_id as it is part of the key.  The identity_ argument can be NULL.

Address Line 1

Location_Party_Address_API.Get_Primary_Cust_Address1(location_id_, address_info_id_, identity_)

Post Code

Location_Party_Address_API.Get_Primary_Cust_Zip_Code(location_id_, address_info_id_, identity_)

 

Alternatively, you could write a select statement querying location_party_address using just location id and returning the first record (rownum=1) if you assume that you only ever have one address against the location.

1 reply

Technical Outlaws
Hero (Employee)
Forum|alt.badge.img+11
  • Hero (Employee)
  • 150 replies
  • Answer
  • March 9, 2023

You could create a read-only custom field that utilises an expression or select statement.  The only thing for you to consider is how to handle locations with multiple addresses?!

 

Utilising the methods in Location_Party_Address_API seems quite straightforward but you need to know the address_info_id as it is part of the key.  The identity_ argument can be NULL.

Address Line 1

Location_Party_Address_API.Get_Primary_Cust_Address1(location_id_, address_info_id_, identity_)

Post Code

Location_Party_Address_API.Get_Primary_Cust_Zip_Code(location_id_, address_info_id_, identity_)

 

Alternatively, you could write a select statement querying location_party_address using just location id and returning the first record (rownum=1) if you assume that you only ever have one address against the location.