How to Access Elements in Form's Embedded List with JavaScript?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2015 07:43 AM
Hello All!
I'm new to using ServiceNow and trying to brush up on my JavaScript. I'm encountering a small issue with not knowing how to access certain elements on my form. Basically, as you can see from the screencap, I have a variety of fields that are of data type "Decimal" in my Product Table Embedded List. I'd like to have it so that the summation of all those fields is put into the "Total Dealer Cost" field. Below is a screencap of both my form and my current Client Script for just when the Admin field is edited. For the script, it alerts that onCellEdit has been entered and that findTotalDealerCost has been entered, so fails when I try to access the Admin field. Could someone point me in the right direction?
Rep Support Form:
Client Script:
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2015 11:11 AM
just write this in calculation block
current.admin+current.insurance+current.reserves+current.overfunds+current.thirdPartyFees+current.associationFee+current.fakePack+current.other
And actually this will also not work as the field names(admin, insurance etc) are wrong, these clearly look like user defined fields and its name would start with u_
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2015 08:54 AM
Hi
I tested it, an onChange Script with getDecimalValue is working