Monday 25 March 2019

Job to insert a record of RetailSalesTable using X++ code in D365FO

In this blog, I will discuss how to insert a record of RetailSalesTable using X++ code.

    public static void main(Args _args)
    {
        SalesTable              salesTable;
        RetailSalesTable        retailSalesTable;
        OMInternalOrganization  internalOrganization;

        salesTable = SalesTable::find("SalesOrderNumber");

        select firstonly Name, RecId from internalOrganization
            where internalOrganization.Name == RetailChannelTable::findByRecId(salesTable.RetailChannelTable).name();

        ttsbegin;
        retailSalesTable.RetailChannel = salesTable.RetailChannelTable;
        retailSalesTable.OMInternalOrganization = internalOrganization.RecId;
        salesTable.packRetailSalesTable(retailSalesTable);
        retailSalesTable.insert();
        ttscommit;
    }













That is all.

No comments:

Post a Comment

Key Updates in Dynamics 365 F&O for Version 10.0.39

Here’s a concise summary of the  platform updates  in  Microsoft Dynamics 365 Finance & Operations version 10.0.39 (March 2024) : 1- Add...