Validation Script for Catalog Item Variable (ent_cost)

othomas1
Kilo Guru

Hello Community,

I am fairly new to servicenow, but i have a variable for my catalog item, that variable name is "ent_cost". I need to use some validation to make sure this variable isnt populated with crazy information, it just needs to contain a dollar sign, decimal and 2 numbers after it. ($0.00). For a client script which table do i look at the accomplish this?

1 ACCEPTED SOLUTION

Mark Stanger
Giga Sage

There is a pretty comprehensive client-script solution here that you could use.

https://community.servicenow.com/community?id=community_article&sys_id=5e1e35d3db0e9f0447c8f3231f961...

Please mark this response correct if I've answered your question.  Thanks!

View solution in original post

8 REPLIES 8

Great.  Let me know how it goes!

Mark, the onChange script still lets me submit the cat item with text in that field do you think changing it to a onSubmit that it would work?

Yes.  As explained at the top of the article, it's designed to be used in an 'onSubmit' script.

It worked, i just need to work on displaying an error message. Thanks again Mark!