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

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Add Execution context to Ribbon Workbench

(2) ShareShare
ReportReport
Posted on by 515

I'm using a Smart Button in Ribbon Workbench to trigger a workflow.

In calledback Javascript I need code to refresh the page after this.

How do I pass Execution Context here?

Nothing I'm trying is working, and I'm just getting error messages.

Thanks
Lee

I have the same question (0)
  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at
    RE: Add Execution context to Ribbon Workbench

    Hi,

    In the command button you should be able to pass Primary Control which acts as execution context for the command buttons.

    this should help you: docs.microsoft.com/.../pass-dynamics-365-data-page-parameter-ribbon-actions

    blog.magnetismsolutions.com/.../getting-dynamics-365-formcontext-from-ribbon-workbench

  • Lee-Martin Profile Picture
    515 on at
    RE: Add Execution context to Ribbon Workbench

    So this would work?

    primaryControl.data.refresh(save).then(successCallback, errorCallback);

    I'm getting an error saying primaryControl is not defined - which is the same as the other errors I've been getting....

  • Mahendar Pal Profile Picture
    45,095 on at
    RE: Add Execution context to Ribbon Workbench

    can you please share some screenshot how you configured it and your code for checking ?

  • Lee-Martin Profile Picture
    515 on at
    RE: Add Execution context to Ribbon Workbench

    The code is as above5861.ribbon.PNG

  • Suggested answer
    ScottDurow Profile Picture
    21 on at
    RE: Add Execution context to Ribbon Workbench

    Assuming you have the latest version of the Smart Button solution installed (https://github.com/scottdurow/RibbonWorkbench/releases), you just need to use:

    context.data.

  • Lee-Martin Profile Picture
    515 on at
    RE: Add Execution context to Ribbon Workbench

    context.data didn't work...context-error.PNG

  • Lee-Martin Profile Picture
    515 on at
    RE: Add Execution context to Ribbon Workbench

    The issue might be around the fact that I'm using a smart button (the principle purpose of the button is to trigger a workflow)

  • Lee-Martin Profile Picture
    515 on at
    RE: Add Execution context to Ribbon Workbench

    Is there a way to put a JavaScript refresh in place using JavaScript for a Smart Button?

  • Community Member Profile Picture
    on at
    RE: Add Execution context to Ribbon Workbench

    yes the workflow

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 76 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

#3
Anthony Blake Profile Picture

Anthony Blake 43 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans