Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested answer

Ribbon Workbench - Smart Button: how can I pass FormContext to che Success Callback Javascript?

(0) ShareShare
ReportReport
Posted on by 30

Hello All,

through Ribbon Workbench I created a SmartButton (Run WebHook type).
Inside the "Success Callback Javascript" section I need to refresh the form,

but to do that I need to be able to access the "FormContext" (and then run formContext.data.refresh(true) )

pastedimage1615291089817v3.png

I know that the formContext is available inside the CrmParameter "PrimaryControl" and in fact I extract it as a parameter: 

pastedimage1615291229413v4.png


But how do I access PrimaryControl inside the section "Success Callback Javascript"?

This is the Success Callback you see in debug:

pastedimage1615291592086v5.png

In console, if I try to access PrymaryControl I get an error: 

pastedimage1615291662517v6.png

Thanks in advance!

Regards,

Stinger

  • Suggested answer
    Fubar Profile Picture
    Fubar 2,752 on at
    RE: Ribbon Workbench - Smart Button: how can I pass FormContext to che Success Callback Javascript?

    Not sure if its available in the callback itself, but Scott has implemented 'context' in smart buttons as the formContext - possibly worth a try.

    www.develop1.net/.../smart-buttons-for-the-unified-interface

  • Suggested answer
    sdfasdf Profile Picture
    sdfasdf 840 on at
    RE: Ribbon Workbench - Smart Button: how can I pass FormContext to che Success Callback Javascript?

    These parameters will all be passed to the Function you define in "Function Name", in the particular order you defined in Ribbon Workbench.

    Since you're also passing a callback function as a parameter, you'll have to implement a "smart" approach to make sure that callback is able to access a reference to the parameter you received from the main function.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,407 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans