Cannot use screen action within the same screen

Hi,

Why we can't use screen action within same screen in web ?

Thanks in advance.

Hi,

Can you detail what your are trying to achieve?

The goal of screen actions is to react to some action on your screen like a button click or an onchange of a input.

Ana Reis

Hi tBt,

for example  if you have screen action as 'Save', you cannot use that for two different buttons? Is that your question?

Please provide more details.

It is a conceptual decision.

Like Ana said, the purpose of a screen action is to provide a response to an user action in the user interface (web screen), like pressing a button, clicking a link, changing the selection on a combo box, etc.

In any case, while you can't call a screen action from within another screen action, you can call the same screen action from more than one place in the screen.

If you need to re-use logic, you can implement it in a Server Action and than call it from within one or more screen actions.

If it seems you need to call a screen action from another one, you should review your logic and user interface.

Cheers,

Eduardo

Here is the example :

I want to add Screen Action CalcDiscount into BuatInvoice Action, but it can't.

Instead, I need to make a screen action in Server Action to accomplish that.


Solution

Yes. You have to use a Server Action to implement this.

Solution

Yes, that is correct.

You cannot call a screen action inside an other screen action. But you can isolate the logic you want to reuse in a server action and than call it on both screen actions. That is the common practice for these scenarios.

Ana Reis

Ic, ok thank you for the information :)

I'm reviving this thread, because there are situations where I want to reuse the logic that can't be included in a server action. For example, I might want to ajax refresh a portion of the screen when two different buttons are clicked.

I should just be able to drag a Screen Action into a Screen action and be done.

Please fix this. This is not very reusable code friendly.

That's Imho absolutely must-to have and easy to implement feature. 

You Could actually use a rich widget called Widget_click to "click" on the desired action  


Don't forget to have a bottom using this action and to check the action in the "Add/Remove Dependencies" After that it should be available for use in the Logic Tab under Richwidgets.

Hi João,


Widget Click performs the execution of the said action only after the execution of the current action is completed, unlike a server action which stops the flow of the current screen action, executes the content of the server action and then comes back to continue with the execution of the screen action. 

Calling Screen actions within Screen Actions would be very useful.

For Example, Upload Widgets need to be submit and if Ajax Refresh needs to be done for the further process then we are forced to use the Hidden - Button Click Mechanism.


Regards,

Rushabh