Posts

Prepay posting vendor invoice with amounts

 class BPContractAddToPendingPrePayVendorInvoice {     PurchTable             purchTable;     VendInvoiceInfoTable   vendInvoiceInfoTable;     VendInvoiceInfoLine    vendInvoiceInfoLine,vendInvoiceInfoLineCount;     VendInvoiceInfoSubTable  vendInvoiceInfoSubTable;     BPInvoiceProposalTable proposalTable;     PurchLine purchLine;     PurchParmUpdate parmupdate;     PurchFormLetter purchFormletter;     PurchPrepayTable prepayTable;     Num parmId;     VendInvoiceJour invoiceJour;     LineAmount applyPrepayAmt;     public void runOperation(BPInvoiceProposalTable _proposalTable,LineAmount _amountPrepay = 0)     {          proposalTable = _proposalTable;         purchTable =  proposalTable.bpProjContractTable().purchTable();     ...

Posting vendor invoice with amounts

 class BPContractAddToPendingVendorInvoice {     BPInvoiceProposalTable proposalTable;     BPInvoiceProposalLine  proposalLine,proposalLineCount;     PurchTable             purchTable;     VendInvoiceInfoTable   vendInvoiceInfoTable;     VendInvoiceInfoLine    vendInvoiceInfoLine,vendInvoiceInfoLineCount;     VendInvoiceInfoSubTable  vendInvoiceInfoSubTable;     PurchLine purchLine;     PurchParmUpdate parmupdate;     PurchFormLetter purchFormletter;     BPInvoiceProposalD proposalId;     Num parmId;     VendInvoiceJour invoiceJour;     LineAmount applyprePayAmt ;     public static void createPendingVendorInvoice(container _callerparameters)     {         BPInvoiceProposalTable propTable =conPeek(_callerparameters, 1);         Line...

Sample runbase with parameters

 class BPAADTerminationTriggerService   extends RunBaseBatch {     TransDate terminationDate;     DialogField fieldTerminationDate;         public server static BPAADTerminationTriggerService construct()         {             return new BPAADTerminationTriggerService();         }     public void initParmDefault()     {         super();         terminationDate = systemDateGet();     }     public Object dialog()     {         DialogRunbase dlg;         ;           dlg                 = super();         fieldTerminationDate        = dlg.addFieldValue(extendedTypeStr(TransDate), terminationDate, "Terminate selected workers upto", "i...

Sample runbase class without parameters

 class BPAADimportTriggerService   extends RunBaseBatch {         public server static BPAADimportTriggerService construct()         {             return new BPAADimportTriggerService();         }         /// <summary>         /// </summary>         /// <returns>Return the class desc</returns>         public client server static ClassDescription description()         {             return "Azure AD user import process";         }         /// <summary>         /// </summary>         /// <returns>Whether the class can be used in a batch task</returns>         protected boolean canGoBatchJournal()     ...

Business events with examples

// Business event base class  [BusinessEvents(classStr(BPAADImportFromEmployeeBusinessEventContract), "Employee AAD import","create AAD user and import as system user",ModuleAxapta::HumanResource)] public final  class BPAADImportFromEmployeeBusinessEvent  extends BusinessEventsBase {     private HCMWorker hcmWorker;     private HCMWorker parmHCMWorker(HCMWorker _hcmWorker = hcmWorker)     {         hcmWorker = _hcmWorker;         return hcmWorker;     }     private void new()     {         super();     }     public static BPAADImportFromEmployeeBusinessEvent construct()     {         BPAADImportFromEmployeeBusinessEvent retVal = new BPAADImportFromEmployeeBusinessEvent();         return retVal;     }     [Wrappable(true), Replaceable(true)]     public Busi...

Form event handlers d365fo with Examples

 //Form control eventHandler  [FormControlEventHandler(formControlStr(HcmWorkerChangeName, OkButton), FormControlEventType::Clicked)]     public static void OkButton_OnClicked(FormControl sender, FormControlEventArgs e)     {         BPAADHCMWorkerLog workerLogUpdate;         FormControl cntrl = sender;         FormRun fr = cntrl.formRun();         FormDataSource fds = fr.dataSource(formDataSourceStr(HcmWorkerChangeName, HcmWorker)) as FormDataSource;         HcmWorker workerLoc = fds.cursor(); }  //Form methods eventHandler  [FormEventHandler(formStr(HcmWorkerNewWorker), FormEventType::Initialized)]     public static void HcmWorkerNewWorker_OnInitialized(xFormRun sender, FormEventArgs e)     {         FormRun fr = sender;         BPAADEmpImportInegraitonParameters parmLoc =  BPAADEmpI...

Form Extensions in d365fo with examples

// Form Extension  [ExtensionOf(formstr(PurchPrepayTable))] final class BPPurchPrepayTableForm_Extension {     public void init()     {         FormRun fr = this ;         boolean invoiceExists;         boolean isFromContract;         BPProjContractTable contractTable;         if (fr.args().dataset() == tableNum(BPProjContractTable))         {  }  next init();         if(isFromContract)         {             FormDataSource fds  = fr.dataSource();        } } // Form datasource field extension [ExtensionOf(formDataFieldStr(ProjWorkBreakdownStructureV2,PSAActivityEstimates, BPProcurementCategory))] final class BPProjWorkBreakdownStrucktureFDSProcuField_Extension {   public Common resolveReference(FormReferenceControl _formReferenceControl)...