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)

Validation on sub-grid

(0) ShareShare
ReportReport
Posted on by 790

dear all

I need to stop proceeding to the next stage when Cities (subgrid) is empty AND current stage is “GATHERING DATA”.

How I can do this?

please check the image below :

433452.Untitled.png

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Shahbaaz Ansari Profile Picture
    6,211 on at

    Hi Ahmad,

    first of all you need to check that Cities subgrid has record in it using fetch xml query or sdk.rest  and along with it also check the stage id or name, and if your condition matches disable the next stage button on business process flow.

    Hope this helps!!!

    Best Regards,

    Shahbaaz

  • Ahmad Saud Profile Picture
    790 on at

    Can you help with some scripts if possible as i dont have such experience.

    thanks,

  • Suggested answer
    Santosh bhagat Profile Picture
    464 on at

    Better to use plugin to validate your requirement. Throw exception if validation failed.

  • Ahmad Saud Profile Picture
    790 on at

    can you help with some scripts?

    thanks,

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    Create a plugin to do that.

    How to retrieve records using Fetchxml

    https://msdn.microsoft.com/en-us/library/gg328117.aspx

    How to retrieve records using Query Expression

    https://msdn.microsoft.com/en-us/library/gg328300.aspx

    if the return result is 0

    throw new InvalidPluginExecutionException("right msg");

    How to Create Plugin

    https://www.youtube.com/watch?v=edOwzUJ30kk

    If you do not have any experiences on doing plugin. You also can use below method

    Create a rollup field

    https://community.dynamics.com/crm/b/meganwalker/archive/2017/09/18/counting-records-with-rollup-fields-and-record-hierarchy

    Create a workflow 

    - if rollup field is 0 , throw error.

    How to throw error in CRM  using real time workflow.

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

     

  • Suggested answer
    Ahmad Saud Profile Picture
    790 on at

    thanks a lot.

    really appreciate.

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 April 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