D365FO - Copy Sales order, using "Copy > from all", does not copy all fields.

Hi,

D365FO - Copy Sales order, using "Copy > from all", does not copy all fields.



Look at the methods initFromSalesTable on SalesTable and initFromSalesLIne for SalesLine.
CustomerRef is not copied from SalesHeader. You might need to customize those methods.
Below Code For Copy from Sales Order to Sales order
[PostHandlerFor(tableStr(SalesLine), tableMethodStr(SalesLine, initFromSalesLine))]
    public static void SalesLine_Post_initFromSalesLine(XppPrePostArgs args)
    {
        //This will be applied while copy sales order
       
        SalesLine salesLine = args.getThis();
        SalesLine _salesLine= args.getArgNum(1);
       ;
        salesLine.urfield= "urvalue" ;
    }
Below code for Copy from Sales order to Purchase Order Copy
/// <summary>
    ///
    /// </summary>
    /// <param name="args"></param>
    [PostHandlerFor(tableStr(PurchLine), tableMethodStr(PurchLine, initFromSalesLine))]
    public static void PurchLine_Post_initFromSalesLine(XppPrePostArgs args)
    {
        PurchLine               purchLine       = args.getThis();
        SalesLine _salesLine= args.getArgNum(1);

        //This will be applied while copy sales order
       
       
            purchLine.urfield"urvalue";
        
    }


Comments

Post a Comment