I'm not sure if this is a bug or if I'm just not understanding. I have an app that uses an AJAX vvcall and when the RPG triggers and uses vvIn_Char it doesn't return what I'd expect. If the app were launched with URL parms like:
image.png?
and that app then does the AJAX vvcall passing that invoice as part of the input of the AJAX call, then the vvIn_Char is picked up as "my invoice", which is expected. However, if instead the app were launched with URL parms like:
image.png?
(initInvc is an app var with the content "my invoice") and that app then does the AJAX vvcall passing that as part of the input of the AJAX call, then the vvIn_Char is picked up as "my%20invoice", which I did not expect. Rather than vvIn_Char returning the input passed into the AJAX call, it is somehow only seeing the URL input parm passed into the app itself and encoded as it would be in a URL.
To fix this I am going to change the name of the input into the AJAX call to not match the name of the app URL input parm, but I don't understand why the vvIn_Char would do different behavior between the launch cases of "[initInvc]" versus "my invoice".
Script:
RPG:
image.png?
Thanks
image.png?
and that app then does the AJAX vvcall passing that invoice as part of the input of the AJAX call, then the vvIn_Char is picked up as "my invoice", which is expected. However, if instead the app were launched with URL parms like:
image.png?
(initInvc is an app var with the content "my invoice") and that app then does the AJAX vvcall passing that as part of the input of the AJAX call, then the vvIn_Char is picked up as "my%20invoice", which I did not expect. Rather than vvIn_Char returning the input passed into the AJAX call, it is somehow only seeing the URL input parm passed into the app itself and encoded as it would be in a URL.
To fix this I am going to change the name of the input into the AJAX call to not match the name of the app URL input parm, but I don't understand why the vvIn_Char would do different behavior between the launch cases of "[initInvc]" versus "my invoice".
Script:
Code:
try {
var myParms = {
"invoice": getAppVar('invoice')
,
"pgm":"APRTEST2",
"action":"print"
};
Ext.Ajax.request({
url: '/valence/vvcall.pgm',
params: myParms,
scope: this,
success: function(response) {
setAppVar('nabInfo', 'Pgm called');
},
failure: function() {
setAppVar('nabMsg', 'Pgm call failed');
}
});
} catch (ex) {
console.error(ex);
}
success();?
Code:
**Free
/Include SpcHdrDft
/Include QCpyLESrc,vvDspec
Dcl-S Invoice Char(24);
Invoice = vvIn_char('invoice');
vvOut_toJsonPair('success:true'); // I put a break point here to see what the value of the invoice variable is
*InLR = *On;
Return;?
image.png?
Thanks

Comment