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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

How to retrieve formContext from PrimaryControlID

(0) ShareShare
ReportReport
Posted on by 247

Hi,

I have a ribbon button on form which is passing "PrimaryControlID" as a CRM parameter. Now I want to retrieve formcontext from it or any other way so that I can work with the attributes of the entity form to retrieve its value or set new value for that attribute. Please let me know any way or I have to change the CRM parameter from "PrimaryControlID" to "PrimaryControl". If this is the only way to pass "PrimaryControl" as a CRM Parameter then what is the way to get the ID of the record which I am using through "PrimaryControlID"

Thanks

AR

I have the same question (0)
  • Suggested answer
    Pradeep Rai Profile Picture
    5,489 Moderator on at

    HI,

    Please check below link:

    https://blog.magnetismsolutions.com/blog/alfwynjordan/2019/10/02/getting-dynamics-365-formcontext-from-ribbon-workbench

    Once you get the formcontext then using below code you will get the record GUID.

    formContext.data.entity.getId();

    Thanks,
    Pradeep.

  • Suggested answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    Hi,

    You can also pass multiple parameters.

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 73 Super User 2026 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

#3
11manish Profile Picture

11manish 50

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans