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

Announcements

News and Announcements icon
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

I have the same question (0)
  • Suggested answer
    sdfasdf Profile Picture
    842 on at

    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.

  • Suggested answer
    Fubar Profile Picture
    2,761 on at

    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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Daniyal Khaleel Profile Picture

Daniyal Khaleel 23 Most Valuable Professional

#2
Syed Aqib Raza Profile Picture

Syed Aqib Raza 19

#3
11manish Profile Picture

11manish 16 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans