- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 03:07 AM
Hello folks,
I have a condition to set a default value of 'Unsubmitted' on a field that's visible only in list view.
I've tried to use this client script onLoad, unsuccessfully failed to update at least one record:
The standard "Defualt Value" works but the value is not visible unless double click on the field.
So far, a backgroupd script work fine by retrieveing a sys_id of a record for testing purposes.
Here's the backgroup script:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 08:03 AM
Hello,
I've resolved my issue, I had to enter a default value before pressing save to create a field.
That way, it updates all the records on the table with the predefined default value and then create choices.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 03:19 AM
Hi @Community Alums
Instead of onLoad client script, Try creating a Before - Insert business rule with the following script.
(function executeRule(current, previous /*null when async*/ ) {
var current_value = current.u_uncheck_status;
if (gs.nil(current_value)) {
var defaultValue = 'Unsubmitted';
current.u_uncheck_status = defaultValue;
}
})(current, previous);
Please mark my answer helpful and accept as a solution if it helped 👍✔️
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 05:36 AM
Thanks @AnveshKumar M,
A Business Rule at Before - Insert will not work, it will require an action, but I gave it a try anyway, it didn't work as expected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 08:03 AM