The Now Platform® Washington DC release is live. Watch now!
‎12-11-2019 07:34 AM
Hello developers,
I have requirement to hide the order confirmation popup window in service portal for a single catalog item.
For that i cloned the existing widget and applied it new page, here in clone widget client script i added this line at funtion get one
$scope.data.sys_properties.twostep= false;
Now, order confirmation is disabled, But it is creating REQXXX instead of Creating RITMXX.
If i remove the newly added line, its working fine
Here im attaching the clone widget code snippets and as well as output of after order confirmation before adding the code and after adding the code
Any leads shoud be appreciated
Thanks
Nag
Solved! Go to Solution.
‎12-18-2019 03:48 AM
Hi,
Here is the updated code.
In your catalog item widget, add this else if condition.
else if (input.action == "order_cat_item") {
var gr = new GlideRecord("sc_req_item");
gr.addQuery('request',input.itemDetails.sys_id);
gr.query();
if(gr.next()) {
data.ritm=gr.sys_id;
}
}
Then go to your catalog item widget and in your client script, add this code in getOne().
$scope.server.get({
action: 'order_cat_item',
itemDetails: {
sys_id: a.sys_id,
name: $scope.data.sc_cat_item.name,
sys_class_name: $scope.data.sc_cat_item.sys_class_name
}
}).then(function(r){
$location.search('id=ticket&is_new_order=true&table=sc_req_item&sys_id=' + r.data.ritm);
});
Mark the comment as a correct answer and also helpful once worked.
‎12-11-2019 08:03 AM
To me it looks like page redirection issue.
1) After code updating image is from the Request page (sc_request page).
2) Before code updating image is from the Requested items page (ticket page)
‎12-11-2019 09:49 PM
Hello Nag,
Can you go to request items and check if RITM is created or not. May be RITM is being created, but it is redirected to request page because we have disabled the popup and generally on click of button in popup it takes you to RITM page.
Mark the comment as a correct answer and helpful if this helps.
‎12-11-2019 10:58 PM
‎12-11-2019 11:13 PM
Hi Nag,
In the client script, under handleRedirect function, add this line and check what is the page output you are getting, after this line
var url = formatRedirectUrl(page, table, sys_id);
, add these 2 lines
console.log("URL is"+url+"---"+page+"---"+table+"----"+sys_id);