Hello Experts,
For one of the scenario, I need to retrieve the Organization Settings.
While debugging the context, I stumbled across one of the property, that can provide me the required values.
Like, I'd want to know the First Day of the Week, which can be obtained by using the below line of code as per the data seen at the time of debugging (please see screenshot) .
Code: context.formatting._currentCultureInfo.dateTimeFormat.firstDayOfWeek
Screenshot:
@jopursle @v-monli-msft @v-xida-msft @AnqiChen So, wanted to understand, can I use the above line of code? If not, then what would be the right approach to achieve it?
Thanks,
Sheldon
It looks like it's supported in our typing file through:
context.userSettings.dateFormattingInfo.firstDayOfWeek
It's also documented
You should not use the undocumented APIs on the context object. For this particular case you can use WebAPI to retrive the value from the cds server and then cache it locally using setControlState for faster rendering for subsequent control load.
Hemant
In general, if an API is not documented, then it is subject to change and usage of it is not supported nor recommended.
WarrenBelz
89
Most Valuable Professional
Michael E. Gernaey
72
Super User 2025 Season 1
mmbr1606
71
Super User 2025 Season 1