Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to calculate total recurring cost in Service Catalog item field

Tom L Logan
Mega Expert

I have created a Service catalog item with 2 Single Line Text fields.  The first Text field is for the Monthly Recurring Cost while the second field is for the Yearly recurring field.  I would like the Yearly recurring field to automatically calculate the sum of monthly x 12 when a number is entered in Monthly recurring field.  Can someone please show me how I can achieve this?  Thank you!

4 REPLIES 4

sachin_namjoshi
Kilo Patron
Kilo Patron

You need to write onsubmit catalog client script to achieve this.

 

For setting Currency via client script there is a great post here

 

 

 

https://community.servicenow.com/people/russ.sarbora/blog/2012/07/20/2543

 

Regards,

sachin

Thanks but can you provide me a sample script.  I am still new to this so cannot wrap my head around the post you referenced. 

Tom L Logan
Mega Expert

Thanks but the post you referenced is not quite what I am looking for.  If you think it is, I am not that great at scripting to make the translation. 

I need to be able to enter an amount in a field called "monthly recurring cost" and have another field called "Yearly recurring cost" automatically show the sum of the amount entered in monthly recurring cost field x12.  In simpler terms, I need the yearly recurring cost field to auto calculate based on what is entered in monthly recurring field.  Any body else with ideas on how I can achieve this?

RiteshSwarnakar
Giga Guru