Days of Week field type value how to get it displayed in portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2022 01:56 PM
Hi All,
We have a custom table with a field u_day_of_week of type Day of Week
Selecting the days stores the value as 1234567 as a string (in the above case the value is stored as 12)
In list view it shows as Mon Tue
How to retrieve and print this value as it shows in list view (getDisplayvalue is not working as it also returns the value as "12")
In EC portal (we have a widget to display the list of custom table records) also the value is displayed as "12",
Is there any way to get this displayed as "Mon Tue." in portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2022 07:36 PM
Hi, I don’t believe that there are ‘displayValues’ and the detail you see in the list view are calculated specifically in the UI by SNC (somewhere), it is never a good idea to leverage undocumented functionality - like 'day_of_week' data type.
A simple solution would be an additional string field that you would update\set with BR or client script based on changes to the day_of_week field, perhaps something like
var myDays = '1 2 6'; //for testing
var myResult = [];
var myReference = ['Mon','Tue','Wed','Thu','Fri','Sat','Sun'];
var mySource = myDays.split(' ');
for (var days in mySource) {
myResult.push(myReference[mySource[days] -1]);
}
gs.info(myResult.toString())