Hi,
I've created a Command Button on a Main Grid for Contacts, in a Model Driven app, that's calling a JavaScript, that's opening a custom page popup <-- all this works.
I then configured the Command Button to pass one parameter ("SelectedControlSelectedItemIds").
The JavaScript function is called with above parameter.
On the custom page for App.OnStart, I then declare a variable as Param("recordIds").
JavaScript on the Command Button, that opens the custom page.
function openCommentPopupGrid(SelectedControlSelectedItemIds)
{
// Centered Dialog
var pageInput = {
pageType: "custom",
name: "rkn_addcommentandclose_92b84",
recordIds: SelectedControlSelectedItemIds.join('|');
};
var navigationOptions = {
target: 2,
position: 1,
height: {
value: 350,
unit: "px"
},
width: {
value: 20,
unit: "%"
},
title: "Add Comment"
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
function () {
// Refresh the main form when the dialog is closed
}
).catch (
function (error) {
// Handle error
}
);
};
Output from the JavaScript, when debuggin:
Command Button
Code in Custom Page running on App.OnStart
Set(varRecordIds, Param("recordIds"));
Result on the Custom Page (see label RecordIds), which is a label configured like this: "RecordIds: " & varRecordIds
And from there the parameter is not passed into the custom page.
I've tried to use different parameters, just to see if there was a difference, but still nothing gets passed into the custom page.
I also tried to add a static variable to the JavaScript, which also was not passed into the custom page.
I also tried to add a static string parameter to the Command Button, which also was not passed into the custom page.
The outcome is the same, whether I chose 1, 2, or more records on the Main Grid.
When doing an almost identical setup, as above, but with a Command Button on a Main Page, it works. - i.e. in runs on a single record on a form.

Report
All responses (
Answers (