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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Accessing a customers contact list through x++

adam260 Profile Picture adam260 1,871
So I working on something where I need to access a customer contacts list through x++ however I found out that the linkage between CustTable and LogisticsElectronicAddress is far and few between so I figured I would post how I was able to regenerate the contact list that is displayed on the CustTable form

The key is to go from CustTable -> DirPartyTable -> DirPartyLocation. Once you have this you need a combination of DirPartyTable and DirPartyLocation to go to LogisticsElectronicAddress

 
 static void findEmailAckTest(Args _args)
{
    CustTable custTable;
    DirPartyTable dirParty;
    LogisticsElectronicAddress electronicAddress;
    DirPartyLocation dirPartyLoc;
   
    //find the customer
    custTable = CustTable::find("21356");
    //find the party for the customer
    dirParty = DirPartyTable::findRec(custTable.Party);
   
    //find all of the contacts for the current customer
    while SELECT  * FROM electronicAddress
    EXISTS JOIN * FROM dirPartyLoc
    WHERE electronicAddress.Location == dirPartyLoc.Location && dirParty.RecId==dirPartyLoc.Party
    {
        info(electronicAddress.Locator);
    }
    
}

This was originally posted here.

Comments

*This post is locked for comments