29 January 2022

How to get sales order delivery postal address Phone ,street in D365FO

 LogisticsPostalAddress deliveryPostalAddress = LogisticsPostalAddress::findRecId(salesTable.DeliveryPostalAddress);

deliveryPostalAddress.City;                   

 deliveryPostalAddress.State;

            

10 January 2022

How to get product variants in D365FO using X++

  public EcoResProductDisplayProductNumber getProductVariants(SalesLine _saleLine)

    {

        InventDimCombination            inventDimCombination  = InventDimCombination::findVariantId(_saleLine.RetailVariantId);

        InventDim                       inventDim;

        InventDistinctProductExpanded   inventDistinctProductExpanded;


        select inventDistinctProductExpanded

            where inventDistinctProductExpanded.ItemId == _saleLine.ItemId

            && inventDistinctProductExpanded.InventDimId == inventDimCombination.InventDimId;


        return inventDistinctProductExpanded.DisplayProductNumber;

    }

How to add the Display method in the form level in D365 F&O

 The below examle is to add the form -Data source level adding display method and assigning to form design control.