Tuesday, August 27, 2019

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

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

            }

1 comment:

  1. In Dynamics 365, you can retrieve multiple customer contact details using advanced find, custom views, or Power Automate for seamless data extraction proton ge ensures efficient integration, enhancing data accessibility and workflow automation.





    ReplyDelete

What is the primary purpose of using a Solution in Microsoft Power Platform & ALM?

As organizations embrace low-code development with Microsoft Power Platform , it becomes essential to manage and govern apps, flows, and dat...