web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :

Get customer multiple contact details in dynamics 365 F&O X++

Rahul Kiran Profile Picture Rahul Kiran 481
In this example I will be showing you how to get a customer contact details  like phone num, email, fax and URL's.

Here, I'm inserting the data in my contract class to use in my API classes.  Pleases change it according to your requirement.


dirPartyLocation.clear();
dirParty = DirPartyTable::findRec(custTable.Party);
        while select dirPartyLocation where dirPartyLocation.Party == dirParty.RecId
            join logisticsElectronicAddress
            where logisticsElectronicAddress.Location == dirPartyLocation.Location
        {
            ContactContract = new ContactContract();
            LogisticsElectronicAddressMethodType logisticsElectronicAddressMethodType  = logisticsElectronicAddress.Type;
            
            logisticsLocation.clear();
            logisticsLocation = LogisticsLocation::find(dirPartyLocation.Location);
            ContactContract.parmDescription(logisticsLocation.Description);
            ContactContract.parmIsPrimary(logisticsElectronicAddress.IsPrimary);
            ContactContract.parmLocator(logisticsElectronicAddress.Locator);
            ContactContract.parmType(enum2Str(LogisticsElectronicAddressMethodType));

            LogisticsElectronicAddressRole logisticsElectronicAddressRole;
            select * from logisticsElectronicAddressRole where logisticsElectronicAddressRole.ElectronicAddress == logisticsElectronicAddress.RecId;
            logisticsLocationRole = LogisticsLocationRole::findRec(logisticsElectronicAddressRole.LocationRole);
            if(logisticsElectronicAddressRole)
            {
                ContactContract.parmPurpose(enum2Str(logisticsLocationRole.Type));// Type Invoice, business, home etc

            }

This was originally posted here.

Comments

*This post is locked for comments