
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2017 03:44 PM
I have a client script where I only want to set the fields to mandatory if the item was created after 6-2017-06-02 23:59:59.
It's not working, can I not do a basic greater than script? My alert comes up empty??? 😞
function onLoad() {
}
var cdt = g_form.getValue('sys_created_on');
alert ("date created is " + cdt);
if (cdt>('2017-06-02','23:59:59')){
Thanks,
Stacy
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2017 03:53 PM
Hello Stacy,
Step 1: Create a display business rule and set the filter condition created date | after | date. The conditioning filter is required here so that this is only trigger per your filter defined.
Place the below line in between function template
g_scratchpad.mand = true;
Step 2: Now create the client script as
if (g_scratchpad.mand)
{
g_form.setMandatory('fieldname',true);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2017 03:52 PM
Hi Stacy,
I don't think form view is applicable based upon the records, if the field is to be set as mandatory then it should be for all records.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2017 03:53 PM
Hello Stacy,
Step 1: Create a display business rule and set the filter condition created date | after | date. The conditioning filter is required here so that this is only trigger per your filter defined.
Place the below line in between function template
g_scratchpad.mand = true;
Step 2: Now create the client script as
if (g_scratchpad.mand)
{
g_form.setMandatory('fieldname',true);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2017 03:58 PM
Reference: Section 3.1 for more info.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2017 04:09 PM
This worked perfectly. Thank you so much.