The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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
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

Narendra Kota
Tera Guru

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)

asifnoor
Kilo Patron
Kilo Patron

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.

Yes asif, Ritm is creating. Is there any way to stop redirecting to request page instead of ritm page

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);