- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2022 03:37 PM
I have written the following Script Include to change the color of a Caller based on their start date and if they are submitting a request within 2 weeks of their start date. Basically I want to use the u_start_date that I have defined in a Form to check for this parameter. I'm not quite sure where I am going wrong but I cannot get the Caller field to show a green dot if their circumstances are true. Does anyone have any suggestions as to how I can pass the u_start_date as a parameter to my greenLight function and then compare it to a date 14 days in the future? I can try to provide further details if needed and have included screenshots as well.
Solved! Go to Solution.
- Labels:
-
User Experience and Design
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2022 04:55 AM
For starters you should be good to go if you change the value to:
javascript: new NewHireCheck().greenLight(current.u_start_date);
I think the field styles also apply on list view level, so you can check if it works there. It should generate a small ball next to the field.
If you can't get the field style to work, consider using a client script.
There's an OOB client script "Highlight VIP Caller" on incident table and it can give an idea on how to do this.
So something like this might work:
var element = g_form.getElement('caller_id');
element.style.backgroundColor = "green";
You might also have to check/uncheck the "isolate script" option on the client script, but it might not be necessary when using g_form.getElement. Though I'd like to note that this is something I digged up from my old archives so I don't know if it still works or has been blocked. Using the "Highlight VIP Caller" script as an example should work no problem: $('label.incident.caller_id');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2022 04:55 AM
For starters you should be good to go if you change the value to:
javascript: new NewHireCheck().greenLight(current.u_start_date);
I think the field styles also apply on list view level, so you can check if it works there. It should generate a small ball next to the field.
If you can't get the field style to work, consider using a client script.
There's an OOB client script "Highlight VIP Caller" on incident table and it can give an idea on how to do this.
So something like this might work:
var element = g_form.getElement('caller_id');
element.style.backgroundColor = "green";
You might also have to check/uncheck the "isolate script" option on the client script, but it might not be necessary when using g_form.getElement. Though I'd like to note that this is something I digged up from my old archives so I don't know if it still works or has been blocked. Using the "Highlight VIP Caller" script as an example should work no problem: $('label.incident.caller_id');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2022 10:59 AM
This worked. Thank you!