Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Suggested answer

Registering a Plugin to avoid a loop

Posted on by 10

My client wishes to have a user enter information on a contact form and then use that information to add the contact to an intermediate table.

I have a created a plug-in to check if the contact being created on the contact form exists or not.

If exists, only enter information on intermediate table, if not create a new contact and enter information on intermediate table.

Issue when a contact exists, a new contact is still created.

Issue when a contact does not exist, 11 contacts get created.

Plugin is registered message: create, event pipeline stage: preoperation.

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,321 Most Valuable Professional on at
    RE: Registering a Plugin to avoid a loop

    Hello,

    There are multiple ways to avoid infinite loop and the most effective one is to check the Depth property of your plugin - if it's not 1 - that might be an infinite loop and just leave the code execution without doing that sync.

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,554 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,588 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans