Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

How to retrieve formContext from PrimaryControlID

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

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: How to retrieve formContext from PrimaryControlID

    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/

  • Suggested answer
    Pradeep Rai Profile Picture
    Pradeep Rai 5,490 Super User 2024 Season 2 on at
    RE: How to retrieve formContext from PrimaryControlID

    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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans