Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer Service forum
Under review by Community Managers

Under review

Thank you for your post! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Switching BPFs

Posted on by 153

I have created two BPFs in the same entity and i want to switch BPF according to my selection in a choice field in the form.

0451.choice.jpg

I am also defining the event handler as on save option.

And my js code which I am using

function onLoadChangeBPFByType(executionContext) {
var formContext = executionContext.getFormContext();
var oppType = formContext.getAttribute(“casetypecode”).getText();
var activeProcessID = formContext.data.process.getActiveProcess().getId();
if (oppType == “Wildfire Case” && activeProcessID.toUpperCase() != “0ffbcde4-61c1-4355-aa89-aa1d7b2b8792”) formContext.data.process.setActiveProcess(“0ffbcde4-61c1-4355-aa89-aa1d7b2b8792”, callBackFunction);
};
function callBackFunction(result) {
if (result == “success”) {} else {}
}

And the error which I am getting is

ReferenceError: Web resource method does not exist: onLoadChangeBPFByType
at y._handleMethodNotExistError (org6de6fc86.crm8.dynamics.com/.../app.js
at y.execute (org6de6fc86.crm8.dynamics.com/.../app.js
at org6de6fc86.crm8.dynamics.com/.../app.js
at i (org6de6fc86.crm8.dynamics.com/.../app.js
at ee._executeIndividualEvent (org6de6fc86.crm8.dynamics.com/.../app.js
at ee._executeEventHandler (org6de6fc86.crm8.dynamics.com/.../app.js
at Object.execute (org6de6fc86.crm8.dynamics.com/.../app.js
at N._executeSyncAction (org6de6fc86.crm8.dynamics.com/.../app.js
at N._executeSync (org6de6fc86.crm8.dynamics.com/.../app.js
at N.executeAction (org6de6fc86.crm8.dynamics.com/.../app.js

Error Details:
Event Name: onsave
Function Name: onLoadChangeBPFByType
Web Resource Name: cr7af_SwitchBPF.js
Solution Name: Active
Publisher Name: DefaultPublisherorg6de6fc86

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,489 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans