0
votes

I am attempting to call an APEX process from a dynamic action. i was able to do that via Execute Javascript code action, by using

apex.submit({request:'PROCESS NAME HERE'})

But I was wondering if there is a better way to do that, such as an APEX action

1
Well Apex provides Submit Page as one of the actions where you could provide the name of the request/button and it basically does the same as apex.submit process but without actually having to write any js code. - Blurryface
but APEX Submit Page does not accept any arguments. Isn't passing an argument to apex.submit with passing a process name different from just a Submit Page? - Coding Duchess
Not if you could include the process name when you do a Submit Page. As I mentioned earlier, you could set the request/button name as one of the settings when you select 'Submit Page' as an action in DA and have the same request applied to the process as well, just like the answer mentioned below. - Blurryface

1 Answers

3
votes

First to say (just to be clear) what you've written in your code as 'PROCESS NAME HERE' is not a process name (as those words might suggest) but a request value, as can be seen from your code.

You can do the very same thing using built-in APEX action:

  1. Choose Submit Page as your Action
  2. Enter your request value (aka the string you clouded with 'PROCESS NAME HERE') under the Request / Button Name field
  3. Under the process you want executed set Server-side Condition as follows:
    • Type: Request = Value
    • Value: your request value (aka the string you clouded with 'PROCESS NAME HERE')
  4. If you have other processes on your page as well that you don't want during this page submit, then you must do some of the following:
    • set their Server-side Condition to exclude that request (this is the easiest way if that process doesn't have any Server-side Condition defined yet): Type: Request != Value , Value: your process value
    • add that process value to excluding list for that process (either add it to the Value while using Request is NOT contained in Value type or change your Request != Value type into Request is NOT contained in Value if you've been excluding only one request before this)

I hope that helped and answered your question.