I have a Javascript code in "JavaScripts" tab of transition form, but it didn't work after deploying.
I also defined the columns "COUNTER", "REASON" (Database Field Name) in the primary table.
Do I miss something?
Cybersecurity
DevOps Cloud
IT Operations Cloud
If an answer to your question is correct, click on "Verify Answer" under the "More" button. The answer will now appear with a checkmark. Please be sure to always mark answers that resolve your issue as verified. Your fellow Community members will appreciate it!  Learn more
I have a Javascript code in "JavaScripts" tab of transition form, but it didn't work after deploying.
I also defined the columns "COUNTER", "REASON" (Database Field Name) in the primary table.
Do I miss something?
It looks like two small code bugs:
1: there is an extra space between "GetFieldValue" and the parenthesis:
Change: GetFieldValue ("COUNTER");
to GetFieldValue("Counter");
2: the predefined Alert function in most browsers is lowercase:
Change: Alert
to alert
Note that depending on how field COUNTER was deployed, the default value might be 0 (instead of empty). This might be exactly what you want but, just note... Any value less than 4, including 0 and negative numbers, will enable REASON, and any amount 4+ will disable REASON. You might need extra bounds checking such as (amount > 0 && amount < 4).
Jraile is correct on GetFieldValue. Using upper case for the field name tells SBM to look for the database field name which is "REASON" in your case. the Camel case "Counter" indicates the display name of the field, so if your displayname was all lower case you would use "counter".
Thank you Jralle, I have corrected error you mentioned, and it works.
Thank you David!