I have used the following code to open but its opening select form that was previously selected by the user already
i have to open randomly by passing its id or something else that can open directly the form which I want to open.
Any advice or help would be great.
function checkbox() {
debugger;
var pageInput = {
pageType: "entityrecord",
entityName: "opportunity",
entityId: "9e0d0283-5bf2-e311-945f-6c3be5a8dd64" //replace with actual ID
};
var navigationOptions = {
target: 2,
height: {value: 80, unit:"%"},
width: {value: 70, unit:"%"},
position: 1
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
function success() {
// Run code on success
},
function error() {
// Handle errors
}
);
}