- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello community,
I have been working in the UI Builder this days and I have noticed that the page "schedule" (now/nav/ui/schedule/cmn_schedule) is not showing monday as first day of week (see picture)
I have been looking for information on the matter an everywhere is mentioned that I should set the following properties to "2"
- glide.ui.filter.first_day_of_week = 2
- glide.ui.date_format.first_day_of_week= 2
- glide.ui.date_picker.first_day_of_week = 2
I have already done that but anything changes, sunday is still first day of week. Has anybody faced this issue? How could I solve it?
Thanks for everything!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
I have already find the answer, but one needs to look at the UI Builder.
If you enter the UI Builder and look for the "Unified Navigation App" experience, you can find the "schedule" page
Once in the Editor Console, look for the configuration property "first day of week" in the "Calendar 1" container and change it to the day of desire.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
58m ago - last edited 36m ago
In fact, for those interested, I synchronized this property with the system property glide.ui.date_format.first_day_of_week. I took as a reference the articles
- How to Create a Data Broker Server Script to Retrieve a Specific Property Value
- UI Builder – Transform Data Broker showing “Data resource is not configured”
You will need to create a Data Broker Server Script (sys_ux_data_broker_transform)
Step 1: Create the Data Broker Server Script
I will call this data broker "getPropertyValue"
In the Data Broker Server Script form, add a property in the "Properties" field as follows to capture the name of the system property you want to retrieve:
[
{
"name": "property_name",
"label": "Name of property",
"description": "Name of the required property",
"readOnly": false,
"fieldType": "string",
"mandatory": true,
"defaultValue": ""
},
{
"name": "default_value",
"label": "Default value for property",
"description": "If the property does not exist or it has no value, then this value is going to be used",
"readOnly": false,
"fieldType": "string",
"mandatory": false,
"defaultValue": ""
}
]
The script that I used was the following (but obviusly one can use its own or propose something different for the community)
function transform(input) {
var getPropertyValue = gs.getProperty(input.property_name);
if (gs.nil(getPropertyValue))
return input.default_value;
return getPropertyValue;
}
Step 2: Define an execute ACL for this Data Broker Server Script
For this data broker to execute, it is necessary to define an ACL of "execute" type.
- Elevate your role to security_admin
- Access sys_security_acl table
- Copy the sys_id of your data broker and search for a ACL with this sys_id as name. If it does not exist, we will need to create it
- if needed it, create a new acl with the following information:
- Type: ux_data_broker
- Operation: execute
- Decision type: allow if
- Name: (Your data broker sys_id)
- Add the required roles / security attributes that you consider
Step 3: Add the data Broker Server Script to the desired page
Once created, we will need to add our data broker to the UI Experience that we need. To to this, access to the page you need (in this case, Unified Navigation App > Schedule) and press the "+" button that you may find in the Data Brokers section (for those who do not know where to find each record in Ui builder, I recommend to you the article "Dude, where's my (UI Builder) Stuff?")
Select your data broker and configure all the fields depending on the property that you want to retrieve
Finally, save your configuration and go to the property "First day of week" that I mentioned in the first comment and bind it to your data broker
Be careful. The property glide.ui.date_format.first_day_of_week understands 1=Sunday, meanwhile in the UI Builder 0=Sunday, that why I am substracting 1 in the previous image. The code I used is the following:
/**
* @Param {params} params
* @Param {api} params.api
* @Param {TransformApiHelpers} params.helpers
*/
function evaluateProperty({api, helpers}) {
return parseInt(api.data.getpropertyvalue_1.output) - 1;
}
I hope this article helps you, Community!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
I have already find the answer, but one needs to look at the UI Builder.
If you enter the UI Builder and look for the "Unified Navigation App" experience, you can find the "schedule" page
Once in the Editor Console, look for the configuration property "first day of week" in the "Calendar 1" container and change it to the day of desire.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
58m ago - last edited 36m ago
In fact, for those interested, I synchronized this property with the system property glide.ui.date_format.first_day_of_week. I took as a reference the articles
- How to Create a Data Broker Server Script to Retrieve a Specific Property Value
- UI Builder – Transform Data Broker showing “Data resource is not configured”
You will need to create a Data Broker Server Script (sys_ux_data_broker_transform)
Step 1: Create the Data Broker Server Script
I will call this data broker "getPropertyValue"
In the Data Broker Server Script form, add a property in the "Properties" field as follows to capture the name of the system property you want to retrieve:
[
{
"name": "property_name",
"label": "Name of property",
"description": "Name of the required property",
"readOnly": false,
"fieldType": "string",
"mandatory": true,
"defaultValue": ""
},
{
"name": "default_value",
"label": "Default value for property",
"description": "If the property does not exist or it has no value, then this value is going to be used",
"readOnly": false,
"fieldType": "string",
"mandatory": false,
"defaultValue": ""
}
]
The script that I used was the following (but obviusly one can use its own or propose something different for the community)
function transform(input) {
var getPropertyValue = gs.getProperty(input.property_name);
if (gs.nil(getPropertyValue))
return input.default_value;
return getPropertyValue;
}
Step 2: Define an execute ACL for this Data Broker Server Script
For this data broker to execute, it is necessary to define an ACL of "execute" type.
- Elevate your role to security_admin
- Access sys_security_acl table
- Copy the sys_id of your data broker and search for a ACL with this sys_id as name. If it does not exist, we will need to create it
- if needed it, create a new acl with the following information:
- Type: ux_data_broker
- Operation: execute
- Decision type: allow if
- Name: (Your data broker sys_id)
- Add the required roles / security attributes that you consider
Step 3: Add the data Broker Server Script to the desired page
Once created, we will need to add our data broker to the UI Experience that we need. To to this, access to the page you need (in this case, Unified Navigation App > Schedule) and press the "+" button that you may find in the Data Brokers section (for those who do not know where to find each record in Ui builder, I recommend to you the article "Dude, where's my (UI Builder) Stuff?")
Select your data broker and configure all the fields depending on the property that you want to retrieve
Finally, save your configuration and go to the property "First day of week" that I mentioned in the first comment and bind it to your data broker
Be careful. The property glide.ui.date_format.first_day_of_week understands 1=Sunday, meanwhile in the UI Builder 0=Sunday, that why I am substracting 1 in the previous image. The code I used is the following:
/**
* @Param {params} params
* @Param {api} params.api
* @Param {TransformApiHelpers} params.helpers
*/
function evaluateProperty({api, helpers}) {
return parseInt(api.data.getpropertyvalue_1.output) - 1;
}
I hope this article helps you, Community!
