Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Is there a way to create a Business Process Error on an entity that prevents a user from creating more than 1 record?

(0) ShareShare
ReportReport
Posted on by

I have a custom entity with fields, which is customized. However, I want to write a plugin in such a way that when a user creates more than 1 record, it generates a Business Process Error saying they cannot create more than 1 record. Is there a way to achieve this?

In other words, they can create 1 record within D365, but when they try to create a new record, it generates the error. Additionally, they have the option to update the current record they had created. 

*This post is locked for comments

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,626 on at
    RE: Is there a way to create a Business Process Error on an entity that prevents a user from creating more than 1 record?

    Hi,

    if the checking is not complex, real time workflow can achieve that too.

    survivingcrm.com/.../using-real-time-workflows-to-show-error-messages

  • Suggested answer
    Pawar Pravin  Profile Picture
    5,237 on at
    RE: Is there a way to create a Business Process Error on an entity that prevents a user from creating more than 1 record?

    Hi ,

    Agree with Arun for plugin approach. Please do create plugin on pre create operation.

    Inside plugin check no of records kind of logic using either query expression or fetch expression.

    If found then through exception.

    Regards,

    Pravin

  • Suggested answer
    Arun Vinoth Profile Picture
    11,615 Moderator on at
    RE: Is there a way to create a Business Process Error on an entity that prevents a user from creating more than 1 record?

    You have to write a pre-create plugin, in which retrieve the count of existing records using fetchxml. If the count is equal to 1, then throw new InvalidPluginExecutionException.

    This will throw Business Process error to user & rollback, so 2nd record won’t be created, but they can update as usual.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
dkrishna Profile Picture

dkrishna 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans