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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Is there anyway to get selected record id from relate section?

(0) ShareShare
ReportReport
Posted on by 12,119 Moderator

Hi all

I need to get selected record on button's click. How can I get selected record id?

7128.8.png

Thank You

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Abed Haniyah Profile Picture
    4,287 on at

    You can use Xrm.Page.data.entity.getId(); if you want to get the current record ID, and if you want to get the selected record ID in a sub grid then refer to :

     https://woodsworkblog.wordpress.com/2014/01/27/crm-2013-adding-an-on-change-event-to-a-sub-grid/

  • Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi Abed Haniyah

    I am getting this error

    8510.11.png

    Where am I wrong? May you please tell me?

    Thank You

  • Community Member Profile Picture
    on at

    Refer this:

    vikramxrm.blogspot.sg/.../read-subgrid-records-ms-crm-2013-using.html

    https://ribbonworkbench.uservoice.com/knowledgebase/articles/129783-pass-the-currently-selected-grid-row-s-to-a-custo

  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at

    Hi Abdul Wahab,

    You can use javascript to get the selected record id.

    var id =Xrm.Page.data.entity.getId();


  • Suggested answer
    Abed Haniyah Profile Picture
    4,287 on at

    Try this code :

    function GetRecordID()

    {

      var Rid = Xrm.Page.data.entity.getId();

      if(Rid == null)

      {

          alert("Id is empty");

      }

      else

      {

          alert(Rid);

      }

    }

  • Verified answer
    Inogic Profile Picture
    709 on at

    To get selected records Ids of grid on the button's click, all you have to do is to use “SelectedControlSelectedItemIds” Parameter in Action.

    0825.s1.jpg

    Note: This will work in case of custom buttons only.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans