Query parameters are additional information appended at the end of a web address. They are separated from the base D365 FO environment URL by a question mark (“?”) and are typically used to pass or query data to a web page. They consist of key-value pairs, where the key and the value are connected by an equal sign (“=”), and multiple pairs are separated by ampersands (“&”). Below is an example of a D365 F&O environment, and respective query parameters:

As we can see from the example above, the query parameters in this case are cmp, which stands for company, and mi, which stands for menu item.

Below are some of the most used query parameters in D365 FO, which will simplify your daily tasks in the system:

  • Query parameter for company: cmp

The cmp key stands for company, and as value you can pass any company name (data area ID) that you have in the system:

  • Query parameter for partition: prt

This query parameter (key) stands for partition. The partitions in D365 FO are used in order to logically separate the data in the tables. You can have multiple partitions, and you must have at least one legal entity or company per partition. Usually only one partition is used in D365 FO, and that is the initial partition, where all the data resides, but it can be that some large corporations have decided to have multiple partitions in order to separate their data. The partition value is added to every query that is ran in the background so that it gives the correct result. If you know the partition value (ID), you can use it as query parameter and filter out the data, like so: prt=ext (ext here stands for Extended partition and is part of the Contoso database in D365 FO).

Please note that in this case my user doesn’t have access to partition ext.

  • Query parameter for menu items: mi

The mi key stands for menu item. It can have various use cases, from calling display or action menu items, to calling some system functionalities with additional parameters. Below you will find more information on various use cases for the menu item key.

    • Display menu items

When trying to call display menu items, all you need to do is pass the name of the display menu item after the equal sign, as shown below:

    • Output menu items

If you’d like to see or send a certain report of combined data, usually you would use output menu items, through which you may pass some parameters and get a report back. When calling output menu items through query parameters, make sure to include Output%3A as a prefix in the value of the menu item key, succeeded by the name of the output menu item, for example: mi=Output%3ACustAgingBalance.

    • Action menu items

When calling an action menu item, the same rule applies as for the output menu item. In order to successfully open an action menu item, you need to put Action%3A as a suffix before the menu item name, like the following example: mi=Action%3ASalesFormLetter_Confirm.

    • System menu items – SysClassRunner

If you would like to test or execute a runnable class (a class which has main method), then you can do that using query parameters without the need to create a dedicated menu item and menu modifications on your existing D365 FO solution. All you need to do is pass a value SysClassRunner to the mi key and as new key-value pair afterwards you will need to put cls=YourClassName, for example: mi=SysClassRunner&cls=RunnableClass1. Please see below:

    • System menu items – SysTableBrowser

As a user in D365 FO, you might want to explore the records of the tables in the background, because the data shown on the forms is usually incomplete, meaning that it doesn’t show the values from all fields in a certain table. When you need to explore some table’s data, you can use query parameters, where as a value for the key mi you set SysTableBrowser, and as additional parameter you specify the tableName key, and as a value you pass the name of the table, like: mi=SysTableBrowser&tableName=CustTable.

  • Query parameter for forms: f

Often it happens that you know the name of the form, but unfortunately you cannot navigate to it, since it may be placed in some custom module where it doesn’t belong to, or it can be placed in a section which logically shouldn’t belong in. In this case, you can specify the form name in the query parameter called f and as value, you need to pass the form name, like so: f=SalesLine.

  • Query parameter for language: lng

If you’d like to change the language of the screen which is being displayed (form, table, menu etc.), but don’t want to adjust the language of your user’s preferences, you can use query parameter lng. Once you pass lng as a key, and as a value you pass one of the supported languages by D365 FO in ISO 639 Type 1 language code format (list can be found here). For example: lng=da, so that the display language is switched to Danish.

  • Query parameter for debugging: debug

Query parameter debug can be useful if you’d like to see how your currently opened solution is performing and what client/server calls are being executed in the background. You need to pass debug as a key in the query parameters, and as value pass true, like so: debug=true. On the right top corner, next to the data entity name, you will see some numbers. Clicking on them will open the overview which you can analyze further.

  • Query parameter for URL manipulation: q

In D365 FO, there is a possibility to create deep links, which basically mean to get a link of the exact current state of the form that you’re looking, so when you send it to your colleagues and they open it, it will be exactly the same as you’ve seen it (with all filters applied). You can do this by going to “Options” on the form’s action pane, and then clicking on “Get a link”. There is, however, another way for this. If you go to user options, and then in preferences find the parameter called “Automatically update query parameter” and set it to “Yes”, and navigate to some form with filters, you will see query parameter q displayed in the URL. Now, if you copy this URL and open it in another tab, the same content will be opened (just as with the deep links). Note that you don’t set any value to this query parameter key, the value is set automatically.

 

Please feel free to contact us if you have any questions or concerns regarding this matter. Thanks for reading.

Written by Cittros team

Subscribe for our insights