
Santhana Rajhan
Mega Sage
Options
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 05-12-2022 01:12 AM
Use this in the server script
/*******************************/
var rightNow = GlideDateTime(); // Get the current time
var morningStart = 4*60*60*1000; // Set numeric value of 4 AM
var afternoonStart = 12*60*60*1000; // Set numeric value of 12 Noon
var eveningStart = 18*60*60*1000; // Set numeric value of 6 PM which 18 in 24 hour format
var welcomeMessage = "";
if(rightNow.getLocalTime().getNumericValue() > morningStart && rightNow.getLocalTime().getNumericValue() < afternoonStart){
data.greeting = "Good Morning, ";
} else if(rightNow.getLocalTime().getNumericValue() > afternoonStart && rightNow.getLocalTime().getNumericValue() < eveningStart){
data.greeting = "Good Afternoon, ";
} else{
data.greeting = "Good Evening, ";
}
/*******************************/
data.name = '';
var firstName = gs.getUser().getFirstName();
if (firstName != '' || firstName != null || firstName != undefined) {
data.name = gs.getUser().getFirstName();
}
/*******************************/
var aisEnabled = $sp.isAISearchEnabled();
if (aisEnabled) {
data.typeAheadSearch = $sp.getWidget('typeahead-search', options);
} else {
data.typeAheadSearch = $sp.getWidget('typeahead-search', options.typeahead_search);
}
/*******************************/
Labels:
Comments
Wesley Ching
Tera Contributor
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
09-27-2023
02:13 AM
Dear Santhana,
Is it a possibilty to share the full widget custom settings? As the server script doesnt seem to work.