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 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

    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();

  • Jeffrey O Profile Picture
    70 on at

    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

    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?')

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 365 | Integration, Dataverse, and general topics

#1
iampranjal Profile Picture

iampranjal 41

#2
Martin Dráb Profile Picture

Martin Dráb 36 Most Valuable Professional

#3
Satyam Prakash Profile Picture

Satyam Prakash 35

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans