Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Regarding getting subgrid records

(0) ShareShare
ReportReport
Posted on by 310

Hello,

On Lead form there is a subgrid for Products, My Scenario is when you click on Disqualify button there is a drop down field for Reason for disqualify  which is mandatory after clicking on disqualify button .

I will not allow to save form untill you select the Product from product subgrid present on Account form , How will I do that 

Using JavaScript Only

*This post is locked for comments

  • Screen one Profile Picture
    Screen one 310 on at
    RE: Regarding getting subgrid records

    it works ...

    Thank You !

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Regarding getting subgrid records

    Hi,

    you mentioned "On Lead form there is a subgrid for Products" ,  in the end "I will not allow to save form untill you select the Product from product subgrid present on Account form" ,  is this true?  

    if the above statement is true, you can use webapi to check if the related entity has data or not. You can use "length" to determine whether it has record or not.

    docs.microsoft.com/.../retrievemultiplerecords

    if you only want to check the subgrid in current form, you can use below method.

    docs.microsoft.com/.../gettotalrecordcount

    How to cancel save operation

    docs.microsoft.com/.../preventdefault

  • Verified answer
    David Jennaway Profile Picture
    David Jennaway 14,063 on at
    RE: Regarding getting subgrid records

    You can use the getSelectedRows method of the Grid object to determine if a record is selected, and you could call this from code in the onSave method. You can cancel the event if no record is selected

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans