Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Switch BPF Programmatically in dynamics 365

Posted on by 92

Hi All,

We have requirements like base on some value need to switch BPF on create of case.

We followed below document, but not get any success. system follow default process only.

https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/model-business-process-flows

We try to skip default system process with set processId on Pre-Validation/Pre-Operation using Plugin.

target('processid') = new Guid("BPFId") / target('processid') = Guid.Empty

But then also system create default BPF instance and set default BPF.

Please help me to achieve this functionality.

Thanks in advance.

  • Maulik Lakhani Profile Picture
    Maulik Lakhani 92 on at
    RE: Switch BPF Programmatically in dynamics 365

    Hi Bipin,

    thanks for the reply.

    this request method has been deprecated. as mention in MS Document 

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/model-business-process-flows

    pastedimage1595827751478v1.png

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Switch BPF Programmatically in dynamics 365

    Hi,

    Can you try below code and see if it works.

    //create an object of setprocess request

              SetProcessRequest setProcess = new SetProcessRequest()

              {

                   //set process entity refrence

                   NewProcess=new EntityReference("workflow",new Guid("D1090355-279E-432C-872F-14414E3AFCC0")),

                  //set target entity refrence

                  Target = new EntityReference("lead", RecordId)

              };

              //Execute Set Process request

             _service.Execute(setProcess);

    If found helpful, Please mark my answer verified.

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans