Invoking a server action from another

Hi,
I have a server action, let’s call it SA1 that is invoked by a form1 in page1.php. SA1 does a lot of calculations and creates a bunch of records in different tables.
SA1 is rather complex (at least for me :grinning: )

I have another server action, let’s call it SA2, which is invoked by forms in page2.php. SA2 is also long and complex, and I’d rather not make it longer by repeating all the steps currently in SA1. Thus, I would like to invoke SA1 from within SA2, and pass to SA1 the equivalent to all the POST variables that form1 passes to SA1.

Is it possible to do that? If so, is there any guidance on how to do it? Alternatively, is there any way to copy the contents of SA1 and paste them into SA2? Doing the work manually is time consuming and error prone.

Many thanks,

Alex

Community Page
Last updated: