We have code that needs to execute in the onArrive of a RAMP script but ONLY if the screen is going to be presented to the user. If the onArrive is executing because RAMP is in the process of Navigating to a destination screen and is just "passing through" the current screen on the way to some other destination screen we do not want to execute this particular code.
Is there some RAMP or global variable/object we can check from a screens onArrive script to determine whether or not RAMP is in the middle of navigating to some other screen?
Detect RAMP Navigation in progress
-
Taku Izumi
- Posts: 63
- Joined: Thu Dec 15, 2016 2:03 pm
Re: Detect RAMP Navigation in progress
If the scenario of screen navigation is the following, I check the oPreviousForm
Screen A(J) -> Screen X(S) -> Screen B(D)
Screen C(J) -> Screen X(S) -> Screen E(D)
onArrive script of Screen X is
Regards,
Taku
Screen A(J) -> Screen X(S) -> Screen B(D)
Screen C(J) -> Screen X(S) -> Screen E(D)
onArrive script of Screen X is
Code: Select all
/* ====================================================== */
/* ================== vHandle_ARRIVE ================== */
/* ====================================================== */
/* Handle arrival at this SPECIAL */
/* oPayload: The payload supplied by the event initiator */
/* oPreviousForm: Reference to previous object Form */
vHandle_ARRIVE: function(oPayload, oPreviousForm)
{
var bReturn = true;
HIDE_CURRENT_FORM();
SETBUSY(true);
/* <ARRIVE /> - Do not remove or alter this line */
if (oPreviousForm.vName == "Screen A")
{
SETVALUE("txtOption","1",1);
SENDKEY(KeyEnter);
}
if (oPreviousForm.vName == "Screen C")
{
SETVALUE("txtOption","2",1);
SENDKEY(KeyEnter);
}
return(bReturn);
},
Taku
-
Tim McEntee
- Posts: 57
- Joined: Thu May 26, 2016 8:46 am
Re: Detect RAMP Navigation in progress
Hi
There is a variable for the target destination form for the current navigation that can be tested but it is volatile and probably not recommended for use.
The method I use is to hard code the command handler name in the arrive script. If for one Command Handler I expect the RAMP script to stop at this destination I execute one set of scripts. I rarely treat destinations as junctions, but with that approach you would execute a different set of code.
if ((objCommand.uUserObjectType == "MYCOMMANDHANDLER") || (objBusinessObject.uUserObjectType != 'CUSTOMERS')) {
... Destination arrive code ...
} else {
... Junction Arrive code ...
}
Tim
There is a variable for the target destination form for the current navigation that can be tested but it is volatile and probably not recommended for use.
The method I use is to hard code the command handler name in the arrive script. If for one Command Handler I expect the RAMP script to stop at this destination I execute one set of scripts. I rarely treat destinations as junctions, but with that approach you would execute a different set of code.
if ((objCommand.uUserObjectType == "MYCOMMANDHANDLER") || (objBusinessObject.uUserObjectType != 'CUSTOMERS')) {
... Destination arrive code ...
} else {
... Junction Arrive code ...
}
Tim