Get electronic address locators of a party by role
When findElectronicAddressByRole no longer fits custom roles, DirParty::electronicAddressLocatorsByRole returns the locators for a party and role.
Written for AX 2012; check DirParty::electronicAddressLocatorsByRole on a current D365FO version.
- First written
- Re-read
- Versions
- AX 2012
Contact information such as e-mail addresses can be tagged with purposes (roles), including custom ones. To read the addresses of a party for a given role, use the method that takes the role name.
The original note
The AX 2012 method findElectronicAddressByRole is deprecated in the latest version.
In the latest version you can define custom roles and use them for custom electronic addresses. This means you can no longer use the standard method to retrieve the address.
This method retrieves the list of locators and returns a container:
LogisticsLocationRoleName logisticsLocationRoleName;
container results;
int i;
;
logisticsLocationRoleName = "CustomRole";
results = DirParty::electronicAddressLocatorsByRole(
[PartyId],
[LogisticsElectronicAddressMethodType],
logisticsLocationRoleName);
for(i=1;i<=conLen(results);i++)
{
info(conPeek(results, i));
}
References
- No Microsoft Learn page was found for this method.