E9.2 How to warn that an SREQ retruns no grid data

JohnDanter2

JohnDanter2

VIP Member
Hi folks

I have an SREQ over P4617 and me confirmign suggestions. This is wrapped in an ORCH and works like a charm.
Issue is if I test this by passing in rubbish (no data found) the SREQ continues on it's merry way and doesn't really error out to say no data found. This is the same if I also do the exact same in the actual app with bad data.

Question is, how can I 'error' out to tell the calling system no data was found?

Could I look in here maybe?
"rowset": [],
"summary": {
"records": 0,
"moreRecords": false
 
Sorted


Code:
// OPTIONAL Code to check for the return of grid data
    if(jsonIn.ServiceRequest1.(jsonIn.ServiceRequest1.keySet()[0]).data.gridData.summary.records = '0')
    { jsonIn.scsResult='200003'
     jsonIn.scsInfo  = ' No Data Found in E1 screen: ' +jsonIn.ServiceRequest1.currentApp   }

will give you
"scsResult": "200003",
"scsInfo": " No Data Found in E1 screen: P4617_W4617B_VJDE0002",
"jde__status": "SUCCESS",
"jde__startTimestamp": "2023-04-04T08:49:22.729-0500",
"jde__endTimestamp": "2023-04-04T08:49:24.154-0500",
"jde__serverExecutionSeconds": 1.425
 
or
scsFormRequest = 'fs_' + jsonIn.ServiceRequest1.currentApp.substring(0, jsonIn.ServiceRequest1.currentApp.lastIndexOf("_"))

if ( jsonIn.ServiceRequest1.(scsFormRequest).data.gridData.summary.records ='0')
{ jsonIn.scsJDResult='200003' }
 
i'm coming to you on my next groovy questions :D

I'm just getting lucky lol
I do love my last example though. As there I'm making a variable in my if condition, which is just like witchcraft in the world of programming lol. I didn't want to hardcode anything in my IF question and want all my groovy scripts to be generic so I can copy paste to other ORCHs.

My resident java geek is helping me loads with this stuff in fairness as he's pointed out to me groovy can actually use java classes/methods to execute code. So he sees a lot of similarities and even if groovy can't do something we want easily he just looks at how to do it in java.
Between the 2 of us, so far we've yet to come across an issue we haven't solved, so yeah bring it on :)
 
I'm just getting lucky lol
I do love my last example though. As there I'm making a variable in my if condition, which is just like witchcraft in the world of programming lol. I didn't want to hardcode anything in my IF question and want all my groovy scripts to be generic so I can copy paste to other ORCHs.

My resident java geek is helping me loads with this stuff in fairness as he's pointed out to me groovy can actually use java classes/methods to execute code. So he sees a lot of similarities and even if groovy can't do something we want easily he just looks at how to do it in java.
Between the 2 of us, so far we've yet to come across an issue we haven't solved, so yeah bring it on :)
Awesome!

I've needed our CNC to load a custom javaclass to help generate proper JWT's within groovy/orch. It ends up working OK
 
Back
Top