Wednesday, February 7, 2024

Get party contact information based on the role type through X++ in Dynamics 365 F&O

 Get any party contact information based on the role type. 

// Phone

addressDetails = DirParty::electronicAddressLocatorsByRole(DirPartyTable::find(companyInfo::find().PartyNumber).RecId,

                                                               LogisticsElectronicAddressMethodType::Email,

                                                               enum2str(LogisticsLocationRoleType::None));

    info(strFmt("MailId: %1",conPeek(addressDetails, 1)));

    

// EmailId

addressDetails = DirParty::electronicAddressLocatorsByRole(DirPartyTable::find(companyInfo::find().PartyNumber).RecId,

                                                              LogisticsElectronicAddressMethodType::Phone,

                                                              enum2str(LogisticsLocationRoleType::None));

No comments:

Post a Comment