Skip to main content

Notifications

Announcements

No record found.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,503 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans