- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2014 09:26 AM
In our change process we have an Impact field that is used in many processes since it is on the task table.
Our requirements for the Impact field was to not have a -- None -- option, but in recent days we needed the impact on change to contain a -- None -- Value and have it defaulted to none initially. We found we could not simply have None added for all tables that used the field.
We tried to use dictionary overrides to allow_null=true for only the change_request table, but this did not add the Null value we were looking for.
HI recommended we use a client script to add the none value to only the change_request table, but we are having difficulty setting the initial default value.
Below is an example of the onload client script we attempted, however every time the client script runs it sets the value to Null, was wondering if anyone knew how to set a default initial default value from a client script and if we might need separate client scripts to split up the tasks. Many Thanks.
function onLoad() {
//Type appropriate comment here, and begin script below
g_form.addOption('impact', '', '-- None --', '0');
g_form.setValue('impact', '', '-- None --');
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2014 10:52 PM
Hi, Christopher. If I understand what you are after correctly then this should do what you want:
function onLoad() {
//Type appropriate comment here, and begin script below
g_form.addOption('impact', '', '-- None --', '0');
if (g_form.isNewRecord()) {
g_form.setValue('impact', '', '-- None --');
}
}
It will only override the impact value when it's a new change_request record being created. The impact value will remain as is for any existing records. The 'None' option will always be available so you may also want to move the 'addOption' statement inside the 'if' statement if you only want 'None' to be available on new records.
Thanks.
- Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2014 10:52 PM
Hi, Christopher. If I understand what you are after correctly then this should do what you want:
function onLoad() {
//Type appropriate comment here, and begin script below
g_form.addOption('impact', '', '-- None --', '0');
if (g_form.isNewRecord()) {
g_form.setValue('impact', '', '-- None --');
}
}
It will only override the impact value when it's a new change_request record being created. The impact value will remain as is for any existing records. The 'None' option will always be available so you may also want to move the 'addOption' statement inside the 'if' statement if you only want 'None' to be available on new records.
Thanks.
- Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2014 11:23 AM
Perfect, Thanks so much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2014 10:35 AM
Actually, I just figured this out a different way. I'm in Calgary, unsure if that matters. This script changed a select box variable "u_worker_classification" to none based on the type of request.
g_form.setValue('u_worker_classification', '');
After the script fires, you see the variable change to "-- None --".