web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

Passing parameters when calling Dynamics 365 for Finance and Operations URLs from external systems

nmaenpaa Profile Picture nmaenpaa 101,160 Moderator

Sometimes you might want to pass some information or commands to your D365FO application when you are opening it from an external system. Use cases might include opening a specific record on a form, setting the mode (read/edit) of the form, or running some logic.

There are many options to achieve this. In this article I will cover some common business requirements and recommended solutions for them.

Open a specific record

For this requirement you should use deep links if possible (https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/user-interface/create-deep-links). With this solution you first call D365FO programmatically and ask it to generate a deep link URL. Then you use this URL to open the form for a specific record.

Menu item parameters

You can achieve a lot by simply defining properties on menu items and creating different menu items for different purposes. Of course this approach will only work with predefined parameter values and is not dynamic.

You might have menu items MyFormRead that opens your form in read mode, and MyFormEdit, that opens your form in edit mode. Or your menu item could include any freetext in the Parameters property.

properties.png

URL parameters

In some scenarios you might need to pass information directly with the URL. Plan carefully when doing this, because URL parameters are sent in plain text and you don´t want to reveal confidential information by using them. If none of the previously mentioned approaches are suitable for your scenario, here's how to send a custom parameter in your URL and handle it in the code.

Let´s suppose that you have a form called myForm and a menu item myForm that opens it.
1. Add this code in the init method of your form:

str myUrlParam = System.Web.HttpUtility::ParseQueryString(URLUtility::getUrl()).Get('myUrlParam');
info(myUrlParam);

2. Add the parameter in the URL: https://myEnvironment.dynamics.com/?cmp=USMF&mi=myForm&myUrlParam=foo

3. When you call the URL, you should see you parameter value in the infolog:

foo2.png

Comments

*This post is locked for comments