Tuesday, October 31, 2023

Code to populate data from BillingSchedule to SalesOrder for custom fields in D365 X++

 [Extensionof(classStr(SubBillCreateSalesOrder))]

internal final class DaxSubBillCreateSalesOrder_Extension

{

   public static SalesTable initSalesTable(

       SalesTable _salesTable,

       boolean _isInvoiceCreator,

       NumberSeq _numberSeq,

       SubBillSalesLineConsolidated _salesLineConsolidated,

       ParmId _curParmId)

   {

      

       SubBillScheduleTable    subBillScheduleTable;

 

       next initSalesTable(_salesTable,_isInvoiceCreator,_numberSeq,_salesLineConsolidated,_curParmId);

    

       select subBillScheduleTable

           where subBillScheduleTable.SubBillBillingScheduleNumber == _salesLineConsolidated.SubBillBillingScheduleNumber;

       _salesTable.DaxName = subBillScheduleTable.DaxName;

 

       return _salesTable;

   }

}

.........................

Output :

SB>All Billing Schedules


AR>All sales Orders






No comments:

Post a Comment