Hi experts,
I have two forms in the case record and 2 separate BPF to be applied.
BPF 1 is already applied on both forms.
I would like to apply BPF 2 to form 2 and I'm using the following code onLoad but its showing script error.
function setDefaultBPF() {
var formId = '3d6a3fccfa-8415-47d2-a4e2-6a94cda3599c';
var businessProcessId = '7bF9000D1B-A393-4BBF-AD31-7678A1EBA056';
var entityName = 'incident';
var FORM_TYPE_CREATE = 1;
var queryStringParams = Xrm.Page.context.getQueryStringParameters();
if (Xrm.Page.ui.getFormType() == FORM_TYPE_CREATE && (queryStringParams.process == null || queryStringParams.process != businessProcessId)) {
var parameters = {};
parameters["formid"] = formId;
parameters["process"] = businessProcessId;
// this will open new Opportunity form with default BPF as specified
Xrm.Utility.openEntityForm(entityName, null, parameters);
}
}
Is there any mistake in the code?
Thanks,
Jon
*This post is locked for comments
I have the same question (0)