Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2015 08:21 PM
Hi,
I studied on how joinquery works, used it and found the answer. here's the code for reference of the others:
var detectReq = new GlideRecord('sc_request');
var detectReqItem = detectReq.addJoinQuery('sc_req_item');
detectReq.addQuery('requested_for',user);
detectReqItem.addCondition('cat_item',catalogSysID);
detectReq.query();
if(detectReq.hasNext()){
errorMessage="Previous request detected. You cannot order this request again";
result='true';
}
else
result='false';
Thank you