Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Is it possible clone existing BPF and assign it to new custom entity by javascript code?

Posted on by Microsoft Employee

I am curious about to know that can we clone existing business process flow and assign it to new custom entity using javascript code?

Any helps will be appreciated.

Thanks in advanced.

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Is it possible clone existing BPF and assign it to new custom entity by javascript code?

    So the workflow will be changed or it will be cloned with new entity?

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Is it possible clone existing BPF and assign it to new custom entity by javascript code?

    Yes it's possible if you have BPF then you can switch process using javascript below method.

    // pass BPF GUID here in below line

    Xrm.Page.data.process.setActiveProcess(procesId, CallBack);

    function CallBack(response) {

    if (response == “success”) {

    alert(“BPF changed !!!”);

    // Save the form

    Xrm.Page.data.entity.save();

    }

    }

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Is it possible clone existing BPF and assign it to new custom entity by javascript code?

    Hi,

    I think the same is answered here: community.dynamics.com/.../866353

    Hope this helps.

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Is it possible clone existing BPF and assign it to new custom entity by javascript code?

    Hi partner,

    Here is a blog about JavaScript with BPF and I'm afraid that there is no related functions with JavaScript.

    https://www.powerobjects.com/2015/10/13/business-process-flows-and-javascript/

    In addition, the requirement that you described should be the logic of custom plug-in. 

    You could try to achieve this by using C# code and creating plug-in.

    Here are some samples about how to use C# to operate BPF.

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/sample-code-processes

    Hope it helps.

    Best Regards

    Leo

  • Verified answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Is it possible clone existing BPF and assign it to new custom entity by javascript code?

    Hi,

    you can refer below article on how to use JS to assign BPF.

    community.dynamics.com/.../162847

    rajeevpentyala.com/.../switch-business-process-flow-using-jscript-based-on-crm-forms-field-value

Under review

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

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans