Remove "Required Information" option on Portal

Community Alums
Not applicable

Hello,

I have a requirement to remove the "Required Information" option on the Portal, So I have cloned the sc_cat_item page and created new widget for "SC Catalog Item" but when I see the page in portal I'm getting below errors. I haven't made any changes to the page yet but still it's not working.

prudhvirajy_0-1744772416221.png

 

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Code on the cloned widget (sc_cat_item) need to be modified as below to fix the issue.

for (var i = 0; i choiceListQuantity.size(); i++) {
var choice = choiceListQuantity.get(i);
if (!isNaN(choice.getValue()))
choicelistQuantityData.push({value : parseInt(choice.getValue()), label : choice.getLabel()});
}

replace with the below code:

for (var i = 0; i choiceListQuantity.getSize(); i++) {
var choice = choiceListQuantity.getChoice(i);
if (!isNaN(choice.value))
choicelistQuantityData.push({value : parseInt(choice.value, 10), label : choice.label });
}

View solution in original post

7 REPLIES 7

@Community Alums 

check both server and client

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Community Alums
Not applicable

Code on the cloned widget (sc_cat_item) need to be modified as below to fix the issue.

for (var i = 0; i choiceListQuantity.size(); i++) {
var choice = choiceListQuantity.get(i);
if (!isNaN(choice.getValue()))
choicelistQuantityData.push({value : parseInt(choice.getValue()), label : choice.getLabel()});
}

replace with the below code:

for (var i = 0; i choiceListQuantity.getSize(); i++) {
var choice = choiceListQuantity.getChoice(i);
if (!isNaN(choice.value))
choicelistQuantityData.push({value : parseInt(choice.value, 10), label : choice.label });
}

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Community Alums 

 

It can be done without code:

 

Turns out there is an OOB option for turning this off! Navigate to the page with the widget you'd like to turn it off for and CTL + Right Click on the widget. Deselect "Show Field Validation Messages." See the screenshots below with "Instance Options."

 

AGLearnNGrow_0-1745040298648.png

 

 

AGLearnNGrow_1-1745040298486.png

 

https://www.servicenow.com/community/developer-forum/how-to-remove-required-information-boxes-from-catalog-item-in/m-p/3241041/emcs_t/S2h8ZW1haWx8dG9waWNfc3Vic2NyaXB0aW9ufE05TEw5RE9SNlRESlFQfDMyNDEwNDF8U1VCU0NSSVBUSU9OU3xoSw#M1196367

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************