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;

    }

No comments:

Post a Comment

Give me the commetns and solutions

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension->...