how to limit the number of requests on a specific item in service portal???

luis-zam
Tera Contributor
I need to limit the number of requests that users can make in a catalog item is specific
find_real_file.png
only for this item you only need to be able to select 3

find_real_file.png
I have already tried to configure the options but this affects all the items, some options that are in the community have already been tried but at the moment none have worked, I hope you can help me.
Thank you.
 
3 REPLIES 3

OlaN
Giga Sage
Giga Sage

Hi,

I would disable the Quantity selector on this Catalog item, and instead create a Catalog variable that allows the user to select a quantity, by creating relevant choices (1,2,3 for example).

Then in your Flow that handles the request, set the Quantity on the RITM from the Catalog variable value.

find_real_file.png

Narsing1
Mega Sage

Hi,

You would need to do like this in order to determine the Quantity value.  Since this is OOTB, we don't have much options other than this.

#1-Create a Widget and name as you like

Name = QuantityChecker

On the Client Controller, copy this (Modify the quantity as per your requirement)

function me($scope) {
    var c = this;
	CustomEvent.observe('onsubcheck', function checker() {
		var selquan = document.getElementById('catItemQuantity').value;
		if(selquan > 3) { //You may change this according to your requirement
			alert("More than 3 is not allowed for this item");
			return false;
		}
	});
}

#2 - Create a Custom/Macro Variable in your Catalog item and provide the Widget name as "QuantityChecker"

#3 - Create a Catalog Client Script 

Type = Onsubmit

function onSubmit() {
   //Type appropriate comment here, and begin script below
   CustomEvent.fire("onsubcheck");
}

Now, you are all set and will see like this when anyone selected the quantity more than  3

find_real_file.png

Please mark it as correct answer if it helps you so that this thread can be closed.

Thanks,

Narsing

Derek Ruesch
Tera Contributor

This solution was very helpful to me! I didn't even know you could do this! Great solution!