web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Field validation for REST API

(0) ShareShare
ReportReport
Posted on by

I have a custom entity for a solution, and I want to validate some fields (like required fields, regex for particular fields etc). Some of the fields were marked required during field creation, but those fileds are only got validated on CRM FORM not for REST API. I also tried out Custom Workflow by following this but that didn't work for me.

How can I do this for REST API?

Regards.

*This post is locked for comments

I have the same question (0)
  • David Jennaway Profile Picture
    14,065 on at

    If you want to validate data as it is created via any means (Crm form, REST API etc), then you'll need to use either a synchronous plugin (which would throw an Exception if the validation fails), or a synchronous workflow (which would cancel the workflow if the validation fails)

  • Suggested answer
    Shidin Haridas Profile Picture
    3,499 on at

    Ensure that the custom workflow you have is 'a real time workflow'.

    Else, it will be an async job.

    For any server side validation, use real-time workflows or plugins.

    And throw exception from the plugin code.

  • Community Member Profile Picture
    on at

    Hi,

    Thanks for the reply I was being able to validate the field for REST API using real time workflows, but the response is not the same as I have set in the workflow. REST API is giving 500 when validation fails, and I wan that the response should be the message which has been set. I have attached the screenshot of workflow.

    worflow.png 

    Thanks,

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans