Presentation
With the arrival of the new 2020 release Wave 1, a very useful feature is now available on D365.
Before when a user wanted to access the record's form from a lookup, or a subgrid for example, he was forced to leave the current form.
With the new release, you will be able, thanks to a little piece of code, to display the desired form into a customized dialog. From this opened form dialog, you could create a new record or edit an existing one. A nice thing to note is that the tab control to navigate in the form will be usable.
To integrate this new feature, D365 devs will create a javascript script where they will have the possibility to define the appearance and the positionning of the dialog.
Let's see an example with this following script
var pageInput = {
pageType: "entityrecord",
entityName: "account",
formType: 2,
};
var navigationOptions = {
target: 2,
width: {
value: 50,
unit:"%"
},
position: 1
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions);
The code displays a dialog to create a new record of type Account. The dialog will be centered and with a width of 50% of the window.
You can also modify the navigationOptions to change the dialog position. Let's change it with:
var navigationOptions = {
target: 2,
width: {
value: 500,
unit:"px"
},
position: 2
};
In this case, the dialog will be on the right of the screen with a width of 500px.
References
You can find more examples on this page:
If you want to know more about the navigateTo function
Add new comment