Hi everyone,
I added two pages which displayed 2 differents Account view (grid), using a custom URL (/main.aspx?appid=xxx&pagetype=entitylist&etn=account&viewid=xxx).
When I double-click on an item of the grid, I want to display a custom form for each views so I developed the following script called when Account onLoad event is raised.
function onLoad(executionContext) {
console.log("############### Account onLoad ###############" );
_formContext = executionContext.getFormContext();
var accountId = _formContext.entityReference?.id.replace(/[{}]/g, '');
var viewId = xxx;
var parameters = {};
parameters["entityName"] = "account";
parameters["entityId"] = accountId;
switch(viewId) {
case "d5ad6904-ffd1-ed11-a7c7-002248cb0048":
parameters["formId"] = "995d836c-ecd2-ed11-a7c7-002248cb0048"; // With times
Xrm.Navigation.openForm(parameters);
break;
case "dff9aa52-00d2-ed11-a7c7-002248cb0048":
parameters["formId"] = "12078bcf-edd2-ed11-a7c7-002248cb0048"; // Without times
Xrm.Navigation.openForm(parameters);
break;
default:
break;
}
}
The problem is how to pass the good ViewId from the grid to the Account details ?
I tried to edit grid Account and used onRecordSelect event but this event is raised only when the user select the record in the grid and not tried to modify it (double click or Modify in the command bar)
Thanks for your help
