getting started with g_form functions

Not applicable

The following client-side script works fine on the incident table (monitoring a Short Description change):

function onChange(control, oldValue, newValue, isLoading) {
if (oldValue == newValue) {return;}
var desc = g_form.getValue('Short_description');
return alert('Short Desc Changed: ' + desc);
}

But when I try the exact same logic and structure on a new table I created,
I don't get any values using the g_form.getValue ….

Is there something that I have to do to initialize a table for use with the g_form functions?
The Wiki appears silent on this … lots of references on the g_form functions, but none of them
Seem to work on a new table …. Help please.

7 REPLIES 7

Mark Stanger
Giga Sage

There's not a whole lot to it other than making sure you're referencing the correct field. In your code above, you have 'Short_description'. This should be 'short_descripton' in order to work. If you have created a new custom field, then the field is probably named 'u_short_description'. You can find out what each field should be referenced by by right-clicking the field in question and selecting 'Personalize Dictionary'. You need to reference whatever is in the 'Column name' field on the dictionary entry.


Thanks .... actually, it does work with the "Short description" as associated with the Incident Table (and form), as that is what is in the list when I do a "personalize". What I am referring to in my new table (form) is also exactly what is listed in that "personalize" list as well .... which is why this is baffling to me.
Anyone else got a suggestion?


I don't know how you would get a field by that name. The out of box element names are always all lower case. Can you attach some screenshots of the dictionary entries for these two fields?


See attached ..... as you can see, when personalizing the form, the "Short description" field is referenced as mixed case, as is the column name in tables and columns (whereas the element name is all lower case, and uses a "_" instead of the space between short and description.) ... but in any case, the g_form.getValue does work with the "Short description" on the Incident Table (and form) but not on a newly created table and form .....

Thanks