Hi,
I would like to create a button that when on click it triggers an automation script that sends an email.
May I know how to do that?
From all the resources I have, I can see a button can trigger many actions but there is no action in reference to automation script.
Needed help, thank you in advance.
Hi Ive, it is a button in the protocol. Sorry for missing this information
Hi Zhing,
It's not possible to trigger a script directly from a button.
You will need to trigger a QAction with your button, which can trigger an automation script.
In your QAction you can then use the protocol.ExecuteScript('myScript'); to trigger your automation script.
Hi Ive,
Thank you so much for your reply. I tried creating a button using the guidance from this link https://docs.dataminer.services/develop/devguide/Connector/UIComponentsButton.html
Afterwards, I chose the option “Generate New QAction” for the button and implement the execute script method you showed me.
But after I click the button, it does not trigger the QAction and execute the automation script. Do you know why?
Hi Zhing,
Do you see any errors in the element logging?
(You can access the element logging, through the menu icon on the top left-hand side of your element card, then view > logging).
Hi Ive,
No there is no error whatsoever. I put protocol.Log(Message) to check and see if the QAction is even being entered but the message did not even show up. It seems like after I clicked the button, it simply does nothing.
Hi Zhing,
I’ve added a new answer so I can share a screenshot of my test code.
Can you share your button parameter definition and QAction definition with us?
Hi Zhing,
Is this a button in a protocol, visio or low-code app?