I would like to pass the value of a Dataverse table column from the Model Driven App to the Canvas Page. The Canvas Page is a Modal window created to upload several documents as attachments to the SharePoint library.

I would like to show or hide a few attachment controls on the canvas page based on the column value in the Model Driven Main Form page.
Here is the JavaScript I am using for the same.
function openCustomPageDialog(primaryControl, firstSelectedItemId, selectedEntityTypeName)
{
// Centered Dialog
var formContext = primaryControl;
var pageInput = {
pageType: "custom",
name: "new_payerdocumentpage_69f77",
entityName: selectedEntityTypeName, // "sample_review"
recordId: firstSelectedItemId, // "{087AA308-B321-E811-A845-000D3A33A3AC}"
param_requestId: formContext.getAttribute("new_requestid").getValue()
};
var navigationOptions = {
target: 2,
position: 1,
height: {
value: 500,
unit: "px"
},
width: {
value: 500,
unit: "%"
},
title: "Upload Documents"
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
function () {
// Refresh the main form when the dialog is closed
primaryControl.data.refresh();
}
).catch (
function (error) {
// Handle error
}
);
}
I am trying to read the value of the parameter param_requestId in Canvas Page OnStart, but the value doesn't show up. I don't understand where am doing wrong.
Set(
gbl_RequestId,
Param("param_requestId")
);
Thanks,
Ramesh