Wednesday 30 May 2018

Get Company Information using x++

tatic void CompanyInfo(Args _args)
{
    CompanyInfo                     companyInfo;
    DirPartyTable                   dirPartyTable;
    LogisticsElectronicAddress      electronic;
    LogisticsPostalAddress          postal;
    LogisticsLocation               location;

    select companyInfo where companyInfo.Name== "Bharat Financial Inclusion Limited"

     Join dirPartyTable

         where companyInfo.RecId == dirPartyTable.RecId

               Join electronic

                   where electronic.RecId == dirPartyTable.PrimaryContactEmail
                        || electronic.RecId == dirPartyTable.PrimaryContactFax
                        || electronic.RecId == dirPartyTable.PrimaryContactPhone
                        || electronic.RecId == dirPartyTable.PrimaryContactURL

                       Join location

                           where location.RecId == dirPartyTable.PrimaryAddressLocation

                                join postal

                                    where postal.Location == location.RecId;

        info(strFmt("%1--%2--%3",dirPartyTable.Name, postal.Address, electronic.Locator));


}

No comments:

Post a Comment