May 18, 2019

QuickFix-3: Runtime functions in Dynamics 365 FO

curExt(): The extension for the current company

curUserId(): current user id.

funcName(): The name of the method that is executing this method

getCurrentPartition():The short name of the current partition (max 8 char).

getCurrentPartitionRecId():The RecId field of the current data partition

getPrefix(): The current execution prefix.

sessionId():The numeric ID of the current session.

prmIsDefault(): 1 if the default value for the parameter was used; otherwise, 0.

-Harry Follow us on Facebook to keep in rhythm with us.

May 13, 2019

How to add 'Actions' on Odata entities

Hi Folks,

In this post, I'll show how to add a new action to D365FO Odata entities which you may want to access in Logic apps or Microsoft Flow. There could be two possible scenarios, either you have custom data entity where you can directly add a method or you have standard data entity for that you need to create extension class.  

First, let's see how to add on the custom entity (yes cause, it's straight forward 😉 ), 

Add your method on data entity and add below attribute
 [SysODataActionAttribute("<MethodName>", false)]
public static void <methodName>(<parameters(optional)>)

Save, Synch and Build your changes. This method should be available now on OData action in the Logic app or Flow. 

Now the other part, how to add the same in Data entity extension. Create a new class and add below attribute.

[ExtensionOf(tableStr(<data entity name>))]
final class <data entity name>_Extension
         [SysODataActionAttribute("<MethodName>", false)]
         public static void <methodName>(<parameters(optional)>)

Pl make sure you use '_Extension' keyword for above class, it's mandatory.

That's all for today. Try it and share your feedback. 

Related topics:

-Harry Follow us on Facebook to keep in rhythm with us.

May 01, 2019

'RunAs' method in Dynamics 365 FO

Hi Folks,

Most of us have used RunAs earlier and it has the same use in D365Fo as well. Sometimes we came across where we need to run a specific business operation under a different user account than the currently logged-in user. To achieve this we can use RunAs to execute a specific operation. This enables the caller to run an X++ method in the security context of another user. This function is most often used with batch processing or workflow submission for another user.

The syntax is really simple as below,

container runAs(
        str userId,
        int classId,
        str staticMethodName
        container params,
        str company,
        str language,
        str partition

The user to impersonate.
The class to invoke in the impersonated session.
The class method to invoke in the new user context.
The parameters to pass to the method; optional. 
The company that is selected for the impersonated session; optional.
The language that is selected for the impersonated session; optional.
The partition key of the type that is returned by the getCurrentPartitionfunction; optional.

Now, let's see how to implement it and take an example of submitting a PR for a different user.

I need to submit a Purchase requisition on behalf of the different user through X++ code. To get this done I need a few details all in a single container type parameter

Hope it will help.

-Harry Follow us on Facebook to keep in rhythm with us.

April 26, 2019

QuickFix-2: Export up to 1 million rows to Excel

The Export to Excel feature can now be configured to allow users to export up to 1 million rows from a grid in Finance and Operations, a substantial increase from the previous 10,000-row limit. By default, the export limit is set to 50,000 rows, but through the Client performance options page, system administrators can adjust the export limit as high as 1 million rows.

Check below link

-Harry Follow us on Facebook to keep in rhythm with us.

April 17, 2019

How to set new admin user post DB refresh

Hi Folks,

Many times we need to get actual data for our development and to get such data in your dev box you need to restore data from either UAT/QA/SIT or any environment which have such data.
Once you complete DB restore in your target system, here issues come, you don't have admin access or maybe SysUser access to this new DB.
Microsoft provides a script to update your email id as admin in your dev box. Follow the below steps to achieve this.

Step 1: Go your DEV box RDP.

Step 2: Go to below path K:\AosService\PackagesLocalDirectory\Bin (In most of the cases it will be same as mentioned if you didn’t found search for ‘PackagesLocalDirectory’ or ‘Packages’ shortcut in one of the drive.

Step 3: Open ‘AdminUserProvisioning’

Step 4: Enter your email Id, which you want to give admin access to this environment and click on submit button.

Step 5: Here you go.


Follow us on Facebook to keep in rhythm with us.

March 05, 2019

QuickFix-1: Delete transaction data in D365FO

To delete all transaction data in a D365 FO environment, use below browser URL. Replace the values with your details and open.

https://<Environment Link>/?mi=SysClassRunner&cls=SysDatabaseTransDelete&cmp=<LegalEntity>

-Harry Follow us on Facebook to keep in rhythm with us.

March 01, 2019

Give method name on a range of AOT Query instead of value

Hi Guys,

Here is a quick tip, how to add methods in an AOT query ranges instead of values. Refer standard query 'CaseListPages_MyOpenCases'

-Harry Follow us on Facebook to keep in rhythm with us.

February 28, 2019

New post series 'QuickFix'

Hi Folks,

I will be starting a new series of the post named as 'QuickFix', where I will be sharing some quick fix to the frequent and small issue while development. I hope you will help you. Keep sharing your feedback if you want to see any specific post. Thanks to all my readers for motivation and support.

-Harry Follow us on Facebook to keep in rhythm with us.

February 24, 2019

Set background color for a field in form grid [DisplayOptionInitialize]

Hi Folks,

Today I am going to discuss how to make a filed text/background colorful :) This could be really helpful if you want to set such color based on an enum, like the status of the record or some kind of color coding on the grid based on an enum value. You can apply color on the entire grid line or one/more specific fields on the grid. So let's get started.

First, let's see how to achieve this using event handler. Assume there is field 'onHold' and you want to set vendor account no background/text to red or green based on this.  Go to your 'VendTable' form and vendTable data source and copy the event handler names 'DisplayOptionInitialize'. Paste this in a new class and write below code under this method (once you paste the event handler).

On new forms, the same can be achieved using overriding 'DisplayOption' method on the data source. Below code will give a hint

public void displayOption(Common _record, FormRowDisplayOption _options)
            VendTable    vendTable = _record;

          //  _options.affectedElementsByField(<FieldName>);
            //    _options.backColor(<Color>);
            super(_record, _options);
Please note, the color thing doesn't work when the user selects a record, it will make the selected line in default color setting. But useful when opening a grid and see the entire set of records.

See more..

Table Event handler methods in Dynamics 365 FO

Form Event handler methods in Dynamics 365 FO

-Harry Follow us on Facebook to keep in rhythm with us.

February 21, 2019

[Solved] Capture screenshots toggle doesn't appear on Task recorder

Hi Folks,

The Task records are slightly different in D365FO than earlier versions. If you are not getting the 'Capture screenshots' toggle on task recorder window on your environment try below steps,

1. Download FMLab folder from Github,
2. Unzip it and there must be a folder named 'TaskRecorderScreenshot'.
3. Now go to google chrome and go to More tool > Extensions
4. Click on 'load unpacked' and select  'TaskRecorderScreenshot' folder from the downloaded FMLab folder.
5. Once done, make sure its enabled on chrome extension.

Restart the chrome and check you must get the 'Capture screenshots' toggle on task recorder window.

Follow us on Facebook to keep in rhythm with us.

February 08, 2019

How to get QueryRange from Query object X++

Hi Folks,

This post is about how to get QueryRange from a query object in x++ code. This is very useful when you have to pass a query on another object and perform a certain operation based on this query and its ranges.

To understand this code sample better, let's take a scenario. On FormA I have to build a query (OR use AOT query) on run time based on certain ranges. When the user clicks on a button system will pass this query to FormB and on FormB we have to use this query and its ranges to perform other sets of operations.

Now let's see the code, which may need to write on Form B to take a query as a parameter and fetch the ranges and its values in code.

I hope this will help.

PS: My VM is down for some reason and I couldn't prove the code and have to write it manually so you might get some syntax issues in the above code.

February 01, 2019

[Solved] Error while generating vendor payment #MSDyn365FO

Hi Folks,

I was getting an error while generating a payment journal, thought accounts payable. Here are a quick summary and solution on the same. 

Error: While creating payment Journal and Click on Generate payments button system throwing below error
Generate payments Message details Cannot edit a record in Journal lines (LedgerJournalTransPayment_BR). The record has never been selected

Possible Reason:
It might be coming to a new environment where you never did a setup for payment method, that you are using in your journal.

1. Go to Methods of payment(Purchase Ledger /Accounts payable > Payment setup > Methods of payment). Select the method with you are using in your journal. Let's take Cheque for eg.
2.  GO to file format tab and check value under field ‘Export format’, which belongs to BR country-specific features.

Ideally, it should match the method of payment. But here its ‘Configurable layout file’ which is not a Cheque layout.

3. So now click on the Setup button and add Cheque in selected formats. Save it and close

4. Change to cheque

5. Now try to generate payment again, it should work.


Follow us on Facebook to keep in rhythm with us.

January 21, 2019

List panel control in Dynamics 365 FO #MSDyn365FO

Hi Folks,

A list panel is an interactive control to assign multiple values to a record. It let the user select multiple records against selected record on a form/grid. To understand it better let's take an example, I want to assign vendor group(s) to an employee so he/she can access those vendor related stuff like Masters, Transactions or PR creation (I am not covering the security in this post, its only about the List panel control). In today’s post I will be creating a new object for a random example, in real time you may need to tweak the solution to fit your requirement.

To do this what I need are
1. A new table to store these data. 1 Employee: N Vendor Groups
2. A new form where I can select an employee and then select one or many vendor groups to this selected employee.
3. List panel on this new form to do actual operation.

First, let's see how my form and table should look like,

and your table browser should look like below,

To achieve this setup you need to create a new table as below

and new form as below,

Now, lets coming to coding part. Although there are many ways to achieve this setup, the best I would recommend is by using  SysListPanelRelationTableCallback framework class. By using this class you can achieve this with minimal coding. You need to add a group on from here we have ListPanelGroup which will be used to create list panel control. Overwrite init method on form and paste below code.

A. Initialize the control.

  1. Form control
  2. Caption for available records in the list
  3. Caption for selected records in the list
  4. ImageId (e.g. #ImageUser)
  5. Relation table: new table which we created to store data.
  6. Relation field: Field which you need to save in table from the list.
  7. Relation range field: Source field which you want to select in relation to binding with related field.
  8. Data table: Source table for list records. here we have VendGroup table.
  9. Data field: Field to be selected from list panel control.
  10. Data container field Ids: Fields that you want to show in available records.
  11. dataRangeField
  12. dataRangeValue
  13. validateMethod
  14. selectedMethod
  15. availableMethod

11-15 parameters can be used to further manipulate the control with some validations.

B. Tab change
Now add a new method on the form to fill the list for previously assigned records

void tabChanged(int fromTab, int toTab)
        switch (toTab)
             case #TabvendGroup:
                 listPanel.parmRelationRangeValue(; //This should be compatible to 7th parameter of SysListPanelRelationTableCallback in init method

C. Tab change
Copy paste below code in tabChanged method to call above method every time when the user changes the tab.

     class Tab
         public void tabChanged(int _fromTab, int _toTab)
             super(_fromTab, _toTab);
             element.tabChanged(_fromTab, _toTab);

That's it, you just created a very simple list panel control with minimal coding.


January 11, 2019

General Electronic Reporting (GER) configuration Import in new environment

Hi Folks,
Generic Electronic Reporting (GER) aka Electronic Reporting (ER) is a great tool to configure document formats for both incoming and outgoing electronic documents in accordance with the legal requirements of various countries/regions. The ER engine let business users use GER without the help of a developer OR any change in code, as user configure the document formats instead of code development. The user can create a different type of documents like JSON, PDF, EXCEL, WORD, XML, and TEXT to support different system requirement. For more details on GER refer MS documentation here.

Now let's see how to move GER configuration from dev to another environment. Once you complete all your change in the respective model or format, change the status to complete with some meaningful description. Post that system will create one more version with draft.

Now you can change the status of a completed version to Shared. If you are facing any error, double check if the configuration repositories are configured properly with LCS. Once you shared a version it will be available on LCS to import in any other environment. You can see them in your LCS project. Log in into


Now in the new environment, make sure you configured repositories properly for both operation and LCS. Select LCS and click Open.

In next screen post LCS connection authorization you must see all customized reporting configuration which is shared over LCS. Select your desired configuration, select the right version and Import it.
That's it….. Smile Configuration is successfully imported into your current machine and ready to use. If you are importing a format, make sure respective data model already exists in your environment. If it's not there you should import the data model as well.