Home

Thursday, July 20, 2017

Find party Email phone and fax based on type ax 365

class TestRunnableClass
{      
    /// <summary>
    /// Runs the class with the specified arguments.
    /// </summary>
    /// <param name = "_args">The specified arguments.</param>
    public static void main(Args _args)
    {    
        /*LogisticsElectronicAddress      logisticsElectronicAddress;
        int64                           party;
        party                        = VendTable::find(PurchTable::find("P000000052").OrderAccount).Party;
        Phone ph=    LogisticsElectronicAddress::findPrimary( VendTable::find(PurchTable::find("P000000052").OrderAccount).Party, LogisticsElectronicAddressMethodType::Phone).Locator;
        info(strFmt("primary is --%1",ph));*/

     
        LogisticsElectronicAddress      logisticsElectronicAddress;
        VendTable vendtable;
        vendTable = VendTable::find("V000000020");
        select Location, Type, Locator,Description from logisticsElectronicAddress
        where logisticsElectronicAddress.Location == DirPartyLocation::findOrCreate(vendTable.Party, 0).Location
        && logisticsElectronicAddress.Type == LogisticsElectronicAddressMethodType::Email
        && logisticsElectronicAddress.IsPrimary == NoYes::Yes;
        info(strFmt("Email is-%1 .. Contact is-%2",logisticsElectronicAddress.Locator,logisticsElectronicAddress.Description));
           
       
    }

}

No comments:

Post a Comment