Calculated Field on Catalog Item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2016 07:33 AM
So, I know how to do this pretty easily on a custom table, but I am looking to do this on a catalog item. I have the variables tra_tuition0, tra_tuition1, and tra_tuition3. On change of these, I want them to automatically fill out tra_tuition_total with the sum of those three numbers?
Thanks in advance for your help!
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2016 06:39 PM
Hi Alex,
An easy way would be to create separate client scripts for setting the value of the empty fields to zero:
function onChange(control, oldValue, newValue, isLoading) {
if (newValue == '') {
g_form.setValue('tra_tuition1', '0') ;
}
}
This will automatically change the field to zero if the number gets deleted
Regards,
ALI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2016 01:16 PM
So another question. This is the method I am using and I made a few scripts, one for each different field but it seems to be calculating funny. Looks like when I fill in two of them it calculates just fine, but when I add a third (and it doesn't matter in which order I fill out the variables) it gives me a decimal... any idea what might be wrong or what 'number' before the variable actually does? (ignore the highlighting)