How to hide the order confirmation popup in service portal for single catalog item

Nag9
Tera Expert

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

1 ACCEPTED SOLUTION

asifnoor
Kilo Patron

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.

View solution in original post

10 REPLIES 10

manish123
Giga Guru

Hi All,


We have upgraded to Orlando and noticed that while checking out through the 2 steps process the Order confirmation window is not working as modal dialog means without filling any details in the Order Confirmation pop up, if I click outside of it. It goes to the Catalog Item page and it shows submitting indefinitely.

Has anyone seen this issue and help or guide me through how to make this order confirmation dialog windo as modal window and prevent user not to click outside of it.