Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Unanswered

Skipping business process flow initialization on related record creation with plugin

Posted on by 5

Hey there,

we have a BPF in place that starts from contact, which isn't needed at the creation of every contact, maybe never.

So I have been trying to use a plug-in to set the processID of said contact to guid.empty (   ) 

This is also refered to in the documentation here: Apply business process flow while creating an entity record.

I'm using the following code at the end. 

Its working as expected, and the processID is set to "0000..." after creation, nevertheless the BPFrecord is still linked and shown in the contact form.

This makes me think, that dynamics handles this differently now? Is there any info about changed behavior?

Could somebody point out a different way to skip the initialization of a BPF record on creation?

Thanks!

Julian

 

public class PreOperationContactCreate : IPlugin

    {
        public void Execute(IServiceProvider serviceProvider)
        {
            IPluginExecutionContext context = (IPluginExecutionContext)
            serviceProvider.GetService(typeof(IPluginExecutionContext));
            Entity target = (Entity)context.InputParameters["Target"];
            target["processid"] = Guid.Empty;
        }
    }

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,532 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,501 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans