web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    RE: Validation on sub-grid

    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
    RE: Validation on sub-grid

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

    thanks,

  • Suggested answer
    Santosh bhagat Profile Picture
    464 on at
    RE: Validation on sub-grid

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

  • Ahmad Saud Profile Picture
    790 on at
    RE: Validation on sub-grid

    can you help with some scripts?

    thanks,

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,626 on at
    RE: Validation on sub-grid

    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
    RE: Validation on sub-grid

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans