Using Sage X3 v12 (2021R3), I try to execute on a TRT the $APRES_CHOI action from STD and SPE.
My process is the following : Object called ZDK, I'm opening an action AZDK1 that opening a custom selection popup (with screens and backend-code).
GACTION = "AZDK1"
Call SAISIE_CHAR(VALBOUT,PARBOUT,"OZDK1","SUBZDK1","SPEZDK1") From GSAISIE
After selecting all field to load, it runs a code that generate element in database. Then I when it come back to the main object ZDK, I want to launch the $APRES_CHOI forcing the RESPONSE var to GSTARAF (1799) that is used to run the screen reload.
In the SPE (SPEZDK) after the field generation, there is a flag that force the $APRES_CHOI to 1799. If I execute any action like : press ENTER, click on a buton... it will reload the screen as I wanted to.
$APRES_CHOI
(...)
If TEST = "OK" Then
REPONSE = GSTARAF
Endif
Return
I tried to run the standard call that I need like this:
Local Char ACTION
ACTION = "APRES_CHOI"
Gosub ACTION From GOBJSUB
But an error meaning that RESPONSE var isn't set appears :
The point is not to declare all the STD var in my SPE as we can find on this post : https://www.sagecity.com/us/sage_erp_x3/f/sage-x3-general-discussion-forum/103996/hot-to-invoke-refresh-button
I just want to run the STD that initialise the var before runing the Gosub ACTION From GOBJET/GOBJSUB/GTRAITE
.
How to call ACTION from STD runing from SPE.
You can try calling the following actions directly to refresh/read the current object record: