Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Currency field needs to be greater than 0.00

Ash41
Kilo Sage

Hello Team, 

     I need a script for below form, when I select type of additional margin field as  'services' and  status of invoicing field as 'billed', calculated add margin field need not to be $0.00, it should be greater than $0.00. it should not allow users to submit form and alert need to be shown. please help me with this.

        Thank you in advance, 

find_real_file.png

1 ACCEPTED SOLUTION

Ash41
Kilo Sage

Thanks you for response Pradeep, I did it on the Client Script , it is working now

function onSubmit() {
//Type appropriate comment here, and begin script below
var am = g_form.getValue('type_of_additional_margin');
var ambs = g_form.getValue('additional_margin_billing_status');
var cmd = g_form.getValue('cm_dollars');
alert(am);
alert(ambs);
alert(cmd);
if (am == 'services'&& am == 'parts' && ambs == 'Billed_to_be_billed' && cmd == 'USD;0.00')
{
return false;
}

}

View solution in original post

2 REPLIES 2

Pradeep Sharma
ServiceNow Employee

Hello Ashok,

 

You can do it via Business Rule. Create a BEFORE Business rule with filter conditions. Screenshot below. Add additional filters per your req. Under actions tab select Add message and Abort checkbox to true.

find_real_file.png

 

Thanks,

Pradeep Sharma

Ash41
Kilo Sage

Thanks you for response Pradeep, I did it on the Client Script , it is working now

function onSubmit() {
//Type appropriate comment here, and begin script below
var am = g_form.getValue('type_of_additional_margin');
var ambs = g_form.getValue('additional_margin_billing_status');
var cmd = g_form.getValue('cm_dollars');
alert(am);
alert(ambs);
alert(cmd);
if (am == 'services'&& am == 'parts' && ambs == 'Billed_to_be_billed' && cmd == 'USD;0.00')
{
return false;
}

}