Monday, January 15

AX 2012 - How to get Vendor contact information in primary to default sequences

Get the Vendor telephone number from dirPartyContactInfoView



static void SL_GetVendorContactInformation(Args _args)
{
    dirPartyContactInfoView        dirPartyContactInfoView;
    VendTable       vendor;
    logisticsElectronicAddress logisticsElectronicAddress;
 
    vendor = VendTable::find("‪‪‪VEND-0000331‬‬");
    select firstOnly Locator from dirPartyContactInfoView
        order by dirPartyContactInfoView.IsPrimary desc
            where dirPartyContactInfoView.Party == vendor.Party &&
                  dirPartyContactInfoView.Type == LogisticsElectronicAddressMethodType::Phone;

   info(strFmt("Address is %1", dirPartyContactInfoView.Locator));

}

No comments:

Post a Comment

Popular Posts