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 365 | Integration, Dataverse...
Answered

Passing CRM Parameters though Ribbon Workbench Custom Button to Javascript Functions to Get Attribute Values

(0) ShareShare
ReportReport
Posted on by 70
I have the same question (0)
  • Verified answer
    Wahaj Rashid Profile Picture
    11,321 on at
    RE: Passing CRM Parameters though Ribbon Workbench Custom Button to Javascript Functions to Get Attribute Values

    Hi,

    Great!

    By the way, when dealing with just one record (button is on the form not on the grid), using formContext to get id is a good idea (no need to pass FirstPrimaryItemId or any other parameter as you ready for the context, it makes it more simple).

    To make it easier for the other readers, please make the appropriate answer as verified (click 'Yes' under 'Did this answer your question?')

  • Jeffrey O Profile Picture
    70 on at
    RE: Passing CRM Parameters though Ribbon Workbench Custom Button to Javascript Functions to Get Attribute Values

    Thanks Wahaj.  I ended up just passing the FirstPrimaryItemId which was simple enough and is working now.

  • Verified answer
    Wahaj Rashid Profile Picture
    11,321 on at
    RE: Passing CRM Parameters though Ribbon Workbench Custom Button to Javascript Functions to Get Attribute Values

    Hi,

    Thank you for your query?

    Where is this button? On the form or a home/sub-grid?

    Please note, SelectedControlSelectedItemReferences parameter is meant to be used when you are selecting one or more records on a grid (and your button appears on the View/Grid).

    If your button is on the form, you can get the current record id using the form context:

    formContext.data.entity.getId();

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
DAnny3211 Profile Picture

DAnny3211 239

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 139 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 91 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans