
Announcements
Hello,
I'm trying to open a form in create mode in a modal.
Xrm.Navigation.navigateTo works fine when not passing formId as a parameter:
var pageInput = {
pageType: "entityrecord",
entityName: "tt_timereport",
};
var navigationOptions = {
target: 2,
height: { value: 80, unit: "%" },
width: { value: 70, unit: "%" },
position: 1
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
function success(result) {
console.log("Record created with ID: " + result.savedEntityReference[0].id +
" Name: " + result.savedEntityReference[0].name)
// Handle dialog closed
},
function error() {
// Handle errors
}
);
but it does not work at all with formId:
var pageInput = {
pageType: "entityrecord",
entityName: "tt_timereport",
formId = "6091111-808C-4C76-A206-F0B11116F52"
}
I should also mention that I have included this form (it is a main form, the second main form in this app) in the App Designer.
Thank you
Try to use the following:
var pageInput = {
pageType: "entityrecord",
entityName: "tt_timereport",
formId: "6091111-808C-4C76-A206-F0B11116F52"
};