Enum values SQL – D365 finance and operation

Enum values in D365 finance and operations stored in a table ‘ENUMIDTABLE’ and ‘ENUMVALUETABLE’. Below is the query to get or verify the enum values

Select eit.NAME,evt.ENUMID,evt.ENUMVALUE, evt.NAME as EnumValueName 
inner join ENUMVALUETABLE evt 
on eit.ID= evt.ENUMID
where eit.NAME='TaxDirection'

QR code for the page:

Security privilege access to the user – D365 finance and operations

To check that user has access to specific privilege in d365 finance and operation use below code

    // <summary>
    /// check user has privilige access
    /// </summary>
    /// <param name = "_privilege">privilege identifier as string</param>
    /// <param name = "_userID">UserId</param>
    /// <returns>boolean</returns>
    public static boolean checkUserHasPrivilgeAccess(str _privilege, UserId _userID = curUserId())
        UserInfo userInfo;
        SecurityUserRole securityUserRole;
        SecurityPrivilege securityPrivilege;
        SecurityRolePrivilegeExplodedGraph securityRolePrivilegeExplodedGraph;

        select firstonly RecId, Id, ObjectId, networkDomain from userInfo
            exists join securityUserRole where securityUserRole.User == _userID
            exists join securityRolePrivilegeExplodedGraph 
                where securityRolePrivilegeExplodedGraph.SecurityRole == securityUserRole.SecurityRole
            exists join securityPrivilege 
                where securityPrivilege.RecId == securityRolePrivilegeExplodedGraph.SecurityPrivilege 
                && securityPrivilege.Identifier == _privilege;

        return userInfo.RecId;

You can get privilege identifier from SecurityPrivilege table using privilege name or description

Leave a comment if you have any question.

Copy multiple attachments between different forms with data – Dynamics 365 for Finance and Operations


Sometime a requirement come that we need to copy multiple attachments from one form to another with the flow of data.
For example when purchase order creates from sales order then the attachments also need to be flow from sales order to purchase order


First thing first -> Identify the relation between new and existing form(tables).

Then use the below code to achieve this.

I used the onInserted event ,you can use the same or whatever suitable for your scenario. Important thing is record should be created in new table then you can copy the attachment.

    /// <summary>
    /// </summary>
    /// <param name=”sender”></param>
    /// <param name=”e”></param>
    [DataEventHandler(tableStr(PurchTable), DataEventType::Inserted)]
    public static void PurchTable_onInserted(Common sender, DataEventArgs e)

        DocuRef docuRef;
        PurchTable purchTable = sender;
        SalesTable salesTable = SalesTable::find(purchTable.InterCompanyOriginalSalesId);

        while select docuRef
              where docuRef.RefCompanyId== salesTable.DataAreaId
              && docuRef.RefTableId == salesTable.TableId
              && docuRef.RefRecID == salesTable.RecId

            docuRef.RefTableId = purchTable.TableId;
            docuRef.RefRecId = purchTable.RecId;


//Leave your comments below if you have any query. I will try to help you to solve your problem

Get email subject and body from email template – D365 finance and operations

        SysEmailTable                   sysEmailTable;
        SysEmailMessageTable            sysEmailMessageTable;
        SysEmailContents                sysEmailContents;
        str                             subject, body;
        SysEmailId                      emailTemplateId = 'DlvNote'; //email template name
        LanguageId                      language = 'en-US';

        select sysEmailTable
               join sysEmailMessageTable
                where sysEmailMessageTable.EmailId==sysEmailTable.EmailId
                    && sysEmailMessageTable.EmailId== emailTemplateId
                    && sysEmailMessageTable.LanguageId==language;

        subject = SysEmailMessage::stringExpand(sysEmailMessageTable.Subject, mappings); //mappings = placeholders
        body    =  SysEmailMessage::stringExpand(sysEmailMessageTable.Mail, mappings);

Create and send SSRS report as attachment through email (using SysOutgoingEmailTable and Interactive and non-Interactive methodology) – D365 finance and operation

Generate report – In this example we are using delivery note report

Copy the below complete code - CustPacking slip email class contains all the code , Report generation, Email template, email place holders mapping, send email using sysoutgoingemailtable and interactive way email 

/// <summary>
/// Class to send packing slip email
/// </summary>
public class CustPackingSlipEmail
    CustPackingSlipJour     custPackingSlipJour;
    Map                     mappings = new Map(Types::String,Types::String);   

    /// <summary>
    /// CustPackingSlipEmail
    /// </summary>
    /// <param name = "_custPackingSlipJour">CustPackingSlipJour</param>
    /// <returns>CustPackingSlipEmail</returns>
    public static CustPackingSlipEmail construct(CustPackingSlipJour _custPackingSlipJour)
        CustPackingSlipEmail CustPackingSlipEmail = new CustPackingSlipEmail();

        return custPackingSlipEmail;

    /// <summary>
    /// CustPackingSlipJour
    /// </summary>
    /// <param name = "_custPackingSlipJour">CustPackingSlipJour</param>
    /// <returns>CustPackingSlipJour</returns>
    public CustPackingSlipJour parmPackingSlip(CustPackingSlipJour _custPackingSlipJour = custPackingSlipJour)
        custPackingSlipJour = _custPackingSlipJour;
        return custPackingSlipJour;

    /// <summary>
    /// generateAndSendPackingSlipReport as binary container
    /// </summary>
    /// <param name = "_args">Args</param>
    public void generateAndSendPackingSlipReport(Args _args)
        //Set  variables
        Array                           arrayFiles;
        SRSProxy                        srsProxy;
        Map                             reportParametersMap;
        SRSPrintDestinationSettings     settings;
        Filename                        fileName =     custPackingSlipJour.InternalPackingSlipId + '.pdf';
        SrsReportRunController          formLetterController = SalesPackingSlipController::construct();
        SalesPackingSlipController      controller = formLetterController;
        SalesPackingSlipContract        contract = new SalesPackingSlipContract();
        System.Byte[]                   reportBytes = new System.Byte[0]();
        SRSReportRunService             srsReportRunService = new SrsReportRunService();
        SRSReportExecutionInfo          executionInfo = new SRSReportExecutionInfo();

        Microsoft.Dynamics.AX.Framework.Reporting.Shared.ReportingService.ParameterValue[] parameterValueArray;
        //set the report contract parameters

        //2nd paramter contract.parm2ndtParameter('2ndParamter value');
        //3rd parameter
        //4th parameter

        //set the report controller parameters
        //set report name and design name

        // Provide printer settings

        settings = controller.parmReportContract().parmPrintSettings();

        // Below is a part of code responsible for rendering the report

        reportParametersMap = srsReportRunService.createParamMapFromContract(controller.parmReportContract());
        parameterValueArray = SrsReportRunUtil::getParameterValueArray(reportParametersMap);
        srsProxy = SRSProxy::constructWithConfiguration(controller.parmReportContract().parmReportServerConfig());

        // Actual rendering to byte array
        reportBytes = srsproxy.renderReportToByteArray(controller.parmreportcontract().parmreportpath(),

        // You can also convert the report Bytes into an xpp BinData object if needed
        container binData;
        Binary binaryData;
        System.IO.MemoryStream mstream = new System.IO.MemoryStream(reportBytes);
        binaryData = Binary::constructFromMemoryStream(mstream);

        if (binaryData)
            binData = binaryData.getContainer();

        SysEmailRecipients recipientEmailAddr = SysUserInfo::find(curUserId()).Email;

        //Send email using sysoutgoing email
        this.sendEmailWithAttachment(binData, fileName, recipientEmailAddr);

        //Send email using interactive methodology
        this.sendEmailWithAttachmentInteractive(binData, fileName, recipientEmailAddr);

    /// <summary>
    /// sendEmailWithAttachment using sysoutgoing email table
    /// </summary>
    /// <param name = "_binData">container</param>
    /// <param name = "_fileName">str</param>
    /// <param name = "_recipientEmailAddr">SysEmailRecipients</param>
    public void sendEmailWithAttachment(container _binData, str _fileName, SysEmailRecipients _recipientEmailAddr)
        SysEmailItemId                  nextEmailItemId;
        SysEmailTable                   sysEmailTable;
        SysEmailContents                sysEmailContents;
        SysOutgoingEmailTable           outgoingEmailTable;
        SysOutgoingEmailData            outgoingEmailData;
        str                             subject;
        Filename                        fileExtension = ".pdf";
        [sysEmailTable, subject, sysEmailContents] = this.getEmailTemplateDetails();
        if (sysEmailTable.RecId > 0)
            nextEmailItemId  = EventInbox::nextEventId();
            outgoingEmailTable.Origin                       = sysEmailTable.Description;
            outgoingEmailTable.EmailItemId                  = nextEmailItemId;
            outgoingEmailTable.IsSystemEmail                = NoYes::Yes;
            outgoingEmailTable.Sender                       = sysEmailTable.SenderAddr;
            outgoingEmailTable.SenderName                   = sysEmailTable.SenderName;
            outgoingEmailTable.Recipient                    = _recipientEmailAddr;
            outgoingEmailTable.Subject                      = subject;
            outgoingEmailTable.Priority                     = eMailPriority::High;
            outgoingEmailTable.WithRetries                  = NoYes::No;
            outgoingEmailTable.RetryNum                     = 0;
            outgoingEmailTable.UserId                       = curUserId();
            outgoingEmailTable.Status                       = SysEmailStatus::Unsent;
            outgoingEmailTable.Message                      =  sysEmailContents;
            outgoingEmailTable.LatestStatusChangeDateTime   = DateTimeUtil::getSystemDateTime();
            outgoingEmailTable.TemplateId                   = sysEmailTable.EmailId;

            if (conLen(_binData) > 0)
                outgoingEmailData.EmailItemId               = nextEmailItemId;
                outgoingEmailData.DataId                    = 1;
                outgoingEmailData.EmailDataType             = SysEmailDataType::Attachment;
                outgoingEmailData.Data                      = _binData;
                outgoingEmailData.FileName                  = _filename;
                outgoingEmailData.FileExtension             = fileExtension;

    /// <summary>
    /// send email as interactive or non interactive methodology
    /// </summary>
    /// <param name = "_binData">container</param>
    /// <param name = "_fileName">str</param>
    /// <param name = "_recipientEmailAddr">SysEmailRecipients</param>
    public void sendEmailWithAttachmentInteractive(container _binData, str _fileName, SysEmailRecipients      
        System.Byte[]               binData1;
        System.IO.Stream            stream1;
        SysEmailTable               sysEmailTable; 
        SysEmailContents            sysEmailContents;
        str                         subject;
        SysIMailerInteractive       mail;
        SysMailerMessageBuilder     messageBuilder;
        Email                       sendFrom = SysUserInfo::find(curUserId()).Email;
        [sysEmailTable, subject, sysEmailContents] = this.getEmailTemplateDetails();
        // Turn the Bytes into a stream
        for (int i = 0; i < conLen(_binData); i++)
            binData1 = conPeek(_binData,i+1);
            stream1  = new System.IO.MemoryStream(binData1);

        //email sending settings
        mail            = SysMailerFactory::getInteractiveMailer();
        messageBuilder  = new SysMailerMessageBuilder();
            .setFrom(sendFrom) // From email address
            .addTo(_recipientEmailAddr) // To Email address
            .setSubject(subject) // Email Subject
            .setBody(sysEmailContents);        //Email Body

        if (stream1 != null)
            //add attachment to the email
            messageBuilder.addAttachment(stream1, _filename);
        //send email

    /// <summary>
    /// getEmailTemplateDetails
    /// </summary>
    /// <returns>container</returns>
    private container getEmailTemplateDetails()
        SysEmailTable                   sysEmailTable;
        SysEmailMessageTable            sysEmailMessageTable;
        SysEmailContents                sysEmailContents;
        str                             subject;
        SysEmailId                      emailTemplateId = this.getCustPackingSlipTemplateEmailId();
        LanguageId                      language = 'en-Au';

        select sysEmailTable
               join sysEmailMessageTable
                where sysEmailMessageTable.EmailId==sysEmailTable.EmailId
                    && sysEmailMessageTable.EmailId== emailTemplateId
                    && sysEmailMessageTable.LanguageId==language;

        subject = SysEmailMessage::stringExpand(sysEmailMessageTable.Subject, mappings);
        sysEmailContents =  SysEmailMessage::stringExpand(sysEmailMessageTable.Mail, mappings);

        return [sysEmailTable, subject, sysEmailContents];

    /// <summary>
    /// Get Email template
    /// </summary>
    /// <returns>SysEmailId</returns>
    private SysEmailId getCustPackingSlipTemplateEmailId()
        SysEmailId emailId = CustParameters::find().DeliveryNoteEmailId; // new parameter field for email template

        if (!emailId)
            throw error("@Label:DeliveryNoteEmailTemplateError");

        return emailId;

    /// <summary>
    /// populate map for email place holders
    /// </summary>
    private void populateEmailMessageMap()
        SalesTable salesTable = SalesTable::find(custPackingSlipJour.SalesId);

        mappings.insert('DeliveryNoteNumber', custPackingSlipJour.PackingSlipId);
        mappings.insert('Version', custPackingSlipJour.InternalPackingSlipId);
        mappings.insert('SalesOrder', custPackingSlipJour.SalesId ); //strFmt("%1", missingHourTmp.Hour));
        mappings.insert('ProjectID', salesTable.ProjId);
        mappings.insert('CustAccount', custPackingSlipJour.OrderAccount);
        mappings.insert('DeliveryName', custPackingSlipJour.DeliveryName);
        mappings.insert('DeliveryAddress', custPackingSlipJour.deliveryAddress());
        mappings.insert('InvoiceName', custPackingSlipJour.InvoicingName);        
        mappings.insert('InvoiceAddress', custPackingSlipJour.invoicingAddress());

Call the above class from the Sales packing slip controller class extension 

public final class custSalesPackingSlipController_Extension
    /// <summary>
    /// Send delivery note email
    /// </summary>
    /// <param name = "_args">Args</param>
    protected static void doMainJob(Args _args)
        boolean sendMail = false;
        if (Box::yesNo('@Label:SendDeliveryNoteEmail', DialogButton::Yes, 
                         '@Label:SendDLvNoteEmail') == DialogButton::Yes)
            sendMail = true;

        next doMainJob(_args);
        if (sendMail)
            CustPackingSlipJour custPackingSlipJour = _args.record();
            CustPackingSlipEmail custPackingSlipEmail = custPackingSlipEmail::construct(custPackingSlipJour);


Send Email with invoice as attachment using Electronic Reporting – Microsoft Dynamics 365 for Finance and Operation


Send Email with invoice as attachment thru electronic reporting


Follow the below steps:

  1. Go to Electronic reporting workspace
  2. Click on the Electronic reporting destination

Screen Shot 2020-04-15 at 12.37.06 pm.png

3. Add new record in file destination grid settings type Émail’

Screen Shot 2020-04-15 at 12.38.33 pm.png

4.  Do the settings on the destination screen as below

Screen Shot 2020-04-15 at 12.41.05 pm.png


5. On To Field click Edit , click  and select print Management Email

Screen Shot 2020-04-15 at 12.42.43 pm

6. For above settings of Email Source account , click on link button before delete button ,it will open the formula designer , you need to select the field AccountNum (customer account number)

It will select the customer email defined on the customer Master contact details as primary

Screen Shot 2020-04-15 at 12.46.24 pm.png


7. click Save and close the formula designer form

8. click on the next two forms and now you can test the email by running the invoice print using print management



Leave your comments below  if you are facing any issue.


To send SSRS report in Email as attachment, please check below link


Send email thru code with Report as attachment – Dynamics 365 Finance and Operations

Copy attachments between different forms with data – Dynamics 365 for Finance and Operations


Sometime a requirement come that we need to copy the attachment from one form to another with the flow of data.

For example when purchase order creates from sales order then the attachment also need to be flow from sales order to purchase order


First thing first -> Identify the relation between new and existing form(tables).

Then use the below code to achieve this.

I used the onInserted event ,you can use the same or whatever suitable for your scenario. Important thing is record should be created in new table then you can copy the attachment.


    /// <summary>
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    [DataEventHandler(tableStr(PurchTable), DataEventType::Inserted)]
    public static void PurchTable_onInserted(Common sender, DataEventArgs e)
        PurchTable purchTable = sender;
        SalesTable salesTable = SalesTable::find(purchTable.InterCompanyOriginalSalesId);
        DocuRef docuRef = DocuRef::findTableIdRecId(salesTable.DataAreaId, salesTable.TableId, salesTable.RecId);

        if (docuRef)
            docuRef.RefTableId = purchTable.TableId;
            docuRef.RefRecId = purchTable.RecId;

Leave your comments below if you have any query. I will try to help you to solve your problem

Business Event Create and Implement – Dynamics 365 For Finance and Operations – X++


Business event introduced in Microsoft Dynamics 365 for Finance and operations to trigger the business process based events and to talk to external systems and by default Microsoft provide some default business(example VendorInvoicePostedBusinessEvent to understand how it works.


Whenever sales invoice is posted then business event should be trigger only in case of specific item. To implement this below is the procedure.

Implementation steps:

3 steps for every business event

1. Build the contract
2. Build the event
3. Code to send the event

Two Classes involves:

Business Event -This class extends the BusinessEventBase , supports constructing the business event, building payload and sending business event

Example of BusinessEvent Class (SalesOrderCreation, update, Delete in that case the BusinessEvent class name should be like SalesOrderCRUDOperation) same goes for Purchase order etc

Business Event Contract – This class extends the BusinessEventsContract class. it defines the payload of business event and allows for population of contract at runtime.



Implementation :

Example is on Creation of Customer Invoice Transactions return specific item number,name, quantity and amount
Define the contract class
public final class CustomerInvoiceTransactionItem90Contract extends BusinessEventsContract
    private ProdName productName;
    private ItemId itemId;
    private int quantity;
    private amount itemAmount;
    /// <summary>
    /// Initialise method
    /// </summary>
    /// <param name = “_invoiceTrans”> </param>
    private void initialize(CustInvoiceTrans _invoiceTrans)
        CustInvoiceJour custInvoiceJour =                CustInvoiceJour::findFromCustInvoiceTrans(_invoiceTrans.SalesId,_invoiceTrans.InvoiceId,_invoiceTrans.InvoiceDate,_invoiceTrans.numberSequenceGroup);
SalesTable salesTable = SalesTable::find(_invoiceTrans.SalesId);
CustTable custTable = CustTable::find(salesTable.CustAccount);
        // get the variable values
        productName =    EcoResProduct::findByProductNumber(_invoiceTrans.ItemId).productName();
 itemId = _invoiceTrans.itemId;
 quantity = _invoiceTrans.quantity;
 itemAmount = _invoiceTrans.LineAmount;
    /// <summary>
    /// </summary>
    /// <param name = “_invoiceLine”></param>
    /// <returns></returns>
    public static CustomerInvoiceTransactionItem90Contract newFromInvoice(CustInvoiceTrans _invoiceLine)
           CustomerInvoiceTransactionItem90Contract contract = new
           return contract;
    private void new()
    [DataMember(‘ProductName’), BusinessEventsDataMember(“Product Name”)]
    public ProdName parmProdName(str _productName = productName)
        productName = _productName;
        return productName;
    [DataMember(‘itemId’), BusinessEventsDataMember(“Item Number”)]
    public str parmSerialNumber(str _itemId = itemId)
        itemId = _itemId;
        return itemId;
    [DataMember(‘quantity’), BusinessEventsDataMember(“Quantity”)]
    public str parmLineId(str _quantity = quantity)
        quantity = _quantity;
        return quantity;
    [DataMember(‘itemAmount’), BusinessEventsDataMember(“itemAmount”)]
    public str parmfoPartyType(str _itemAmount = itemAmount)
        itemAmount = _itemAmount;
        return itemAmount;
Define the Business Event Class
    “Customer Invoice Transaction”,
    “This business event is triggered when an invoice is created.”,
     public class CustInvoiceTransCreatedBusinessEvent extends BusinessEventsBase
     CustInvoiceTrans custInvoiceTrans;
      private custInvoiceTrans parmInvoiceTrans(CustInvoiceTrans _custInvoiceTrans =              custInvoiceTrans)
         custInvoiceTrans = _custInvoiceTrans;
         return custInvoiceTrans;
     private void new()
     [Wrappable(true), Replaceable(true)]
     public BusinessEventsContract buildContract()
         return      CustomerInvoiceTransactionItem90Contract::newFromInvoice(custInvoiceTrans);
    static public CustInvoiceTransCreatedBusinessEvent    newFromInvoice(CustInvoiceTrans _custInvoiceTrans)
         CustInvoiceTransCreatedBusinessEvent event = new       CustInvoiceTransCreatedBusinessEvent();
         return event;
Code to invoke the event : below is the code that invoke the business event classes that we define above
 [DataEventHandler(tableStr(CustInvoiceTrans), DataEventType::Inserted)]
    public static void CustInvoiceTrans_onInserted(Common sender, DataEventArgs e)
        CustInvoiceTrans invoiceTrans = sender as CustInvoiceTrans;
        boolean isEvent = BusinessEventsConfigurationReader::isBusinessEventEnabled(classStr(CustInvoiceTransCreatedBusinessEvent));
        if (isEvent)
  • After finishing the above code and rebuilding the project then you have to go business event catalogue in the system administration
  • You will find your newly created business event in the list
  • Then from your end point application register the business event , once successfully registered than you will find the end point in your business event catalog Endpoint tab
  • Activate the business event , you are ready to use the newly created business event.


Note: Business event can be activated only in 1 legal entity  or all , if you don’t selected any legal entity during activation then it will be activated for all else only for selected legal entity

Mark record in the grid get on the form data source – AX2012 R3 – Dynamics 365 for Finance and Operations

Scenario: You have 10 records in the grid and want to select(mark) on 5 and perform operations.  Then use below code to select mark records

Solution 1:


Hcmworker hcmWorker; // table

hcmWorker = this.getfirst(1);// 1 is reflecting the mark records

while (hcmworker)


//write custom code to perform operations


hcmworker = this.getNext()



Solution 2:


Hcmworker hcmWorker; // table





The natural key for the table was not found. Microsoft Dynamics 365 for Finance and Operations – Microsoft Visual Studio

Scenario: Sometimes users facing the error ‘The natural key for the table was not found‘.


Screen Shot 2019-12-06 at 4.16.23 PM.png



Open the table on which you are facing error. Then add the primary index like below


Screen Shot 2019-12-06 at 4.19.25 PM.png


After adding index synchronize the table and then try to create Data entity again.

A financial dimension value is based on the ” record and has been used on a transaction. You cannot delete the ” record – Dynamics 365 for finance and operations – AX2012 R3


Sometime user trying to delete a record from the customer master or any data that relates to financial dimension. So, user is facing above error upon deletion.


Error occurred because data exists in the table DimensionAttributeLevelValue


  1. Access the open the table DimensionAttributeLevelValue 
  2. filter the record by Display Value field with the desired record to delete like customer number or employee number etc etc
  3. Select the filtered records
  4. Delete the selected records
  5. Then go back to customer master or where you facing the error
  6. Now try to delete you will be able to delete


AX 2012: you can directly delete the record by opening table

D365 : you can delete by access the SQL or write the runnable class to delete


How to apply platform update on local VM or development VM Dynamics 365 for Finance and Operations

Scenario: We were using dev environment of Dynamics Finance and Operations with Application release version 10.0 platform update 24. Microsoft released a new version 10.0.5 with platform update 26.

Now we have two options to use the new version.

  1.  Download new VM and moved the custom models to the newly created VM
  2. upgrade the current VM on the latest update

In first option we need to create and setup the testing data again to test the code.

2nd option everything will remain same and no extra effort needed other than the applying update.

Definitely we selected the 2nd option and below steps were performed to update the environment.


  • Download the latest release package from the asset library to the local VM development environment
  • Unzip the zip file to the local VM in C drive by creating a custom folder (folder should not be in the users folder directory). I created  with below name FnO10.0.234.10001App
  • Stop the following services (Batch, Data import and IIS)
  • Close Visual studio instances
  • open command prompt as administrator
  • set the directory to your custom folder contains the unzip files
    • C:\FnO10.0.234.10001App>
  • Run the below command to check the list of components installed
    • C:\FnO10.0.234.10001App>AxUpdateInstaller.exe list
  • From the above command you will get all the components already installedCommponents versions before update.png
  • update the DefaultTopologyData.xml file located in the update folder in my case located in below location
    • FnO10.0.234.10001App -> DefaultTopologyData.xml


  • Best way to update this file copy on another location edit like below and replace in the above folderDefaultTopologyData file.png


  • Generate the run book thru command prompt using below command
    • Actual command: AXUpdateInstaller.exe generate -runbookid=[runbookID] -topologyfile=[topologyFile] -servicemodelfile=[serviceModelFile] -runbookfile=[runbookFile]
    • [runbookID]– A parameter that is specified by the developer who applies the deployable package.
    • [topologyFile]– The path of the DefaultTopologyData.xml file.
    • [serviceModelFile]– The path of the DefaultServiceModelData.xml file.
    • [runbookFile]– The name of the runbook file to generate (for example, AOSRunbook.xml).
    • Should be modify as below
    • AXUpdateInstaller.exe generate -runbookid=”Dev-runbook” -topologyfile=”DefaultTopologyData.xml -servicemodelfile=”DefaultServiceModelData.xml” -runbookfile=”Dev-runbook.xml”


  • Import the run thru command prompt using below command
    • AXUpdateInstaller.exe import -runbookfile=”Dev-runbook.xml”


  • Execute the runbook thru command prompt using below command
    • AXUpdateInstaller.exe execute -runbookid=”Dev-runbook”

runbook execute.png

This step is the longest step involving many sub-steps performed during this step.

Some steps even takes 2,3 or may more hours. please make sure system will not logout neither shutdown.

if any step fails during this step use below command to rerun

For me its fails on 19 step

runbook step rerun.png


Wait till last step completed


runbook execution complete.png


  • Verify the installation by running below command
    • AXUpdateInstaller.exe list

updated version list.png

You can check the version also by login to the dynamics browser about option.


Screen Shot 2019-11-26 at 11.37.19 AM.png


Please leave comment in the comments section if you are facing any issue while updating. I will try to assist.


Good luck!!!


Chain Of command – Forms – Dynamics 365 for Finance and Operations – X++

Chain of Command now supports the more scenarios for the extensions on forms:

Now you can wrap the methods on forms, Forms data sources, Datafields and on form control methods.

  1. Forms
  2. Form Data Sources
  3. Form Controls
  4. fields in data sources

Below is the complete example of Form Data source and just a code snippet for the rest. In below example we are updating the ratingmodel based on our custom logic that is global variable on the form.

Note: use element.FormToExtendVariable to access the form variables and datasources

Use element.FormToExtendMethod() to call the form methods

Screen Shot 2019-11-03 at 3.20.34 PM.png


  1. [ExtensionOf(FormStr(FormName))] // for form extension
  2. [ExtensionOf(FormControlStr(FormName,FormControl))] // for form control method extension
  3. [ExtensionOf(FormDataFieldStr(FormName,FormDataSource,DataField))] // for form datasource method extension
  4. [ExtensionOf(FormDataSource(FormName,FormDataSource) // for form data source extension

How to Extend form init(Pre or Post) Methods in D365FnO? – Microsoft Dynamics 365 for Finance and Operations – D365FnO – X++

Scenario: Sometimes you need to extend the form init method in Dynamics 365 for Finance and Operations.

Below is sample code to extend:



/// <summary>


    /// </summary>

    /// <param name=”args”></param>

    [PostHandlerFor(formStr(HcmRatingLevelIdLookUp), formMethodStr(HcmRatingLevelIdLookUp, init))]

    public static void HcmRatingLevelIdLookUp_Post_init(XppPrePostArgs args)


        FormRun fr = args.getThis();

       //you have form run object to access the controls and datasources of form