Tuesday, March 23, 2021

Get current company's Contact Information In D365 FO

 Get current company's Contact Information In D365 FO.

    

    static void CompanyPhone(Args _args)

{

    DirPartyLocation            dirPartyLocation;

    LogisticsElectronicAddress  electronicAddress;

    CompanyInfo                 companyInfo;

    

    companyInfo = companyInfo::find();

    

    select dirPartyLocation

        where dirPartyLocation.Party == companyInfo.RecId

        &&  dirPartyLocation.IsPostalAddress == NoYes::No

        join electronicAddress

        where electronicAddress.Location == dirPartyLocation.Location

        && electronicAddress.Type == LogisticsElectronicAddressMethodType::Phone;

    {

        info(strFmt("Description: %1, Contact number/address: %2",  electronicAddress.Description, electronicAddress.Locator));

    }

}

Keep Daxing!!

No comments:

Post a Comment