Hi guys,
In my Model-driven app, I've added a command button to which will open Custom Page. A Javascript has been created, something like this :
function openPageInlineWithContext(selectedItems)
{
var selectedItem = selectedItems[0];
if (selectedItem) {
let pageInput = {
pageType: "custom",
name: "new_accountpage_d32ca",
entityName: selectedItem.TypeName,
recordId: selectedItem.Id,
};
let navigationOptions = {
target: 1
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions)
.then(
function () {
// Handle success
}
).catch(
function (error) {
// Handle error
}
);
}
}
Which in one of the lines is this code -> recordId: selectedItem.Id
It is mentioned that is to "handle" the record id to be passed to Custom Page when it is called.
Now in my Custom Page, I have this code in OnStart method :
Set(RecordItem,
If(IsBlank(Param("recordid")),
Blank(),
LookUp(Accounts, Account = GUID(Param("recordid")))
)
)
But if I tested this Param("recordid") in some Label inside my app, it always empty. May I know how to pass the record from Model-driven View to Custom Page ?
The command button in the main grid, when setting the Javascript, I put the parameter to "SelectedControlAllItemReferences"

Is this option wrong for me to choose ? or is there anything else that make the record id is not going to my Custom Page ?
Thanks