cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

Can the undocumented but available functions be used?

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:

ConsoleDataPCFContext.png

 

@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

1 ACCEPTED SOLUTION

Accepted Solutions
Power Apps Staff AnqiChen
Power Apps Staff

Re: Can the undocumented but available functions be used?

It looks like it's supported in our typing file through:

context.userSettings.dateFormattingInfo.firstDayOfWeek

 

It's also documented

https://docs.microsoft.com/en-us/powerapps/developer/component-framework/reference/dateformattinginf...

View solution in original post

5 REPLIES 5
rajyraman
Level: Powered On

Re: Can the undocumented but available functions be used?

Power Apps Staff MikeHuguet
Power Apps Staff

Re: Can the undocumented but available functions be used?

In general, if an API is not documented, then it is subject to change and usage of it is not supported nor recommended.

Power Apps Staff HemantG
Power Apps Staff

Re: Can the undocumented but available functions be used?

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 

Power Apps Staff AnqiChen
Power Apps Staff

Re: Can the undocumented but available functions be used?

It looks like it's supported in our typing file through:

context.userSettings.dateFormattingInfo.firstDayOfWeek

 

It's also documented

https://docs.microsoft.com/en-us/powerapps/developer/component-framework/reference/dateformattinginf...

View solution in original post

Re: Can the undocumented but available functions be used?

Thanks @AnqiChen for your help!

 

Helpful resources

Announcements
thirdimage

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Users online (6,166)