How to trigger a set of actions from multiple places?

  • 1
  • Question
  • Updated 2 years ago
  • Answered
  • (Edited)
I have a snippet plus a set of actions that I want to execute from multiple places on my page. Right now I have duplicated them as actions fired on multiple tabs in a tab set via each tab's "Whenever Shown" properties. Is there a way that I can instead trigger a single set of the actions from the each tab's properties? Maybe I need an action that calls a very simple snippet that calls a new button's actions, and that button has a single set of the needed actions? I want to centralize all of the activity (so that changes can be made once) but I also don't want to create any processing overhead, such as loading a fake model from the database (Salesforce) to make it work.
Photo of Peter Bender

Peter Bender, Champion

  • 6,246 Points 5k badge 2x thumb

Posted 2 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Yup. This does it.

In your snippet you would enter the name of the event into the following:
skuid.events.publish(eventnamehere)
Photo of Peter Bender

Peter Bender, Champion

  • 6,246 Points 5k badge 2x thumb
Thanks, I had forgotten about event publishing. Haven't tried that yet for anything, but it looks like it is all code, so I'll have to set aside some time to look into it.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Strange. Not sure what happened to the link I provided. This component allows you to setup action framework that could be called from a line of javascript or from another action.

https://community.skuid.com/skuid/topics/template-component-with-action-framework

How to here.
https://community.skuid.com/skuid/topics/another-use-for-mb-template-w-action-framework-call-action-framework-from-anywhere-on-page