Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Validation on sub-grid

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

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

    thanks a lot.

    really appreciate.

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 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

     

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

    can you help with some scripts?

    thanks,

  • Suggested answer
    Santosh bhagat Profile Picture
    Santosh bhagat 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
    Ahmad Saud 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
    Shahbaaz Ansari Profile Picture
    Shahbaaz Ansari 6,203 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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans