Hi,
I need to call screen action using javascript in traditional application, how can i do that?
thanks,
Bhuvan
Hi
If screen action is available to access by js you can simply call it by $actions.your action name.
Regards
Hi @Bhuvan Chandra Vechalapu ,
You can achieve this by following below steps.
1)drag and drop one button in same page and make visible property to No(hide the button)
2) Attach screen action to the button which you want to call by javascript.
3) Now use onclick function for this button to trigger it's logic in javascript code.
Like this you can call screen action.
Thanks,
Arun
Hi Bhuvan,
Please refer below thread, You can find sample oml file in below thread.
https://www.outsystems.com/forums/discussion/61169/how-to-call-screen-action-in-javascript-in-outsystem-web/
Thanks.
Hi @Bhuvan Chandra Vechalapu,
You can simply call it using $actions.ActionName(). In below screenshot you can see that under Screen Actions you can find all available screen actions, you just double click on it and it will create code for you. Find .oml file also for your easy reference
Best of luck
People, read the question carefully before replying, this is a out traditional web. $actions. is only available for reactive web and mobile.
Can you please explain the scenario where you want to implement this?
You can also refer to this forum discussion
https://www.outsystems.com/forums/discussion/5977/calling-a-screen-action-from-javascript/#:~:text=To%20have%20a%20javascript%20function,%2C%20for%20instance%20'MyButton'.
In your case you are using some action to trigger the JS.
In my case the action while will trigger the JS is "Action_That_Will_Trigger_JS". It calls the "ScreenAction" throught JS code that is trigger by "Action_That_Will_Trigger_JS".
Thanks & Regards,
Sudip Pal
Darg the "RunJavaScript" server action from HTTPRequestHandler and use this ""document.getElementById('"+ ScreenAction.Id +"').click()"" js in the server action.
ScreenAction.Id is the id of the screen action you want to trigger.