Hi everyone,
I have the following JS function applied to a Command Button. This is being used to open a Custom Page dialog in a Model Driven App. All working fine.
function openStrategicApproval(primaryControl, firstSelectedItemId, selectedEntityTypeName) { // Centered Dialog var pageInput = { pageType: "custom", name: "new_requeststrategiccaseapproval_ad938", entityName: selectedEntityTypeName, // "sample_review" recordId: firstSelectedItemId // "{087AA308-B321-E811-A845-000D3A33A3AC}" }; var navigationOptions = { target: 2, position: 1, height: { value: 300, unit: "px" }, width: { value: 12, unit: "%" } }; Xrm.Navigation.navigateTo(pageInput, navigationOptions).then( function () { // Refresh the main form when the dialog is closed primaryControl.data.refresh(); } ).catch ( function (error) { // Handle error } ); }
Problem:
What I would like to do is pass a String parameter into this function so that I can leverage it in the Custom Page.
However, I cannot identify what I would need to revise in the JS function in order to accommodate the additional String parameter. In the example below, I have added the parameter into the openStrategicApproval function (primaryControl, firstSelectedItemId, selectedEntityTypeName, String). However, I am not well versed enough in JS to know where I need to place it. For example, I have added it into the Custom page object, but I do not think this is correct.
JS Code:
function openStrategicApproval(primaryControl, firstSelectedItemId, selectedEntityTypeName, String)
{
// Centered Dialog
var pageInput = {
pageType: "custom",
name: "new_requeststrategiccaseapproval_ad938",
entityName: selectedEntityTypeName, // "sample_review"
recordId: firstSelectedItemId, // "{087AA308-B321-E811-A845-000D3A33A3AC}"
powerautomateflow: String
};
var navigationOptions = {
target: 2,
position: 1,
height: {
value: 300,
unit: "px"
},
width: {
value: 12,
unit: "%"
}
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
function () {
// Refresh the main form when the dialog is closed
primaryControl.data.refresh();
}
).catch (
function (error) {
// Handle error
}
);
}
Custom Page Formula
Best regards,