25 June 2019

Admin provisioning tool can't stop DynamicsAXBatch service

Admin provisioning tool can't stop DynamicsAXBatch service 
System.ComponentModel.Win32Exception: The service cannot accept control messages at this time in D365

  • Click the Start menu
  • Click Run or in the search bar type services.msc
  • Press Enter
  • Look for the service and check the Properties and identify its service name. Service name would be DynamicsAxBatch
  • Once found, open a command prompt. Type: sc queryex [servicename].
  • Press Enter
  • Identify the PID
  • In the same command prompt type: taskkill /f /pid [pid number]
  • Press Enter
  • Now start the service and and register yourself in the Admin Provisioning Tool

21 June 2019

How to access form data source using Form control in the event handler in D365 or AX7

How to access form record using Form control in the event handler in D365 or AX7

[FormControlEventHandler(formControlStr(InventJournalTransfer, Functions), FormControlEventType::Clicked)]

public static void Functions_OnClicked(FormControl sender, FormControlEventArgs e)
    {
        InventJournalTrans      inventJournalTrans;
        InventJournalTable      journalTable;

        FormRun form = sender.formRun();
        FormDataSource journalTable_ds  =       form.dataSource(
        formDataSourceStr(InventJournalTransfer,InventJournalTable)) as FormDataSource;
        journalTable                   = journalTable_ds.cursor();

    }

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->...