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

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 > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 75 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 52 Super User 2025 Season 2

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 42 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans