function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
atulit27atulit27 

How to access Standard fields StartDay and EndDay of Standard Object User?

I am writing an apex class and need the two standard fields StartDay and EndDay of standard object User in my method. But when I am Querying them the error shown is:

Error: Compile Error: No such column 'StartDay' on entity 'User'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names. at line 13 column 20

 

Can somebody help me to how to access these two fields?

Bhawani SharmaBhawani Sharma

User onject doesn't have these field. Where did you get to know that these two are in User.

atulit27atulit27

These two fields are present in user just check in your personal information there are these fields which are picklist. You can aslo check them in List of Standard Fields of User Object in your Salesforce Account.

Bhawani SharmaBhawani Sharma

I checked in the API and couldn't find anything. Can you please send the screen shot ?

NBlasgenNBlasgen




End of Day
EndDayPicklist 
 ExtensionExtensionPhone 
 FaxFaxFax 
 Hourly Login LimitLoginLimitNumber(9, 0) 
 Info EmailsReceivesInfoEmailsCheckbox 
 LanguageLanguageLocaleKeyPicklist 
 LocaleLocaleSidKeyPicklist 
     
   Text(512) 
 Start of DayStartDayPicklist
NBlasgenNBlasgen

Talked to Salesforce support.  They say the fields aren't directly accessible from the API (duh) but that if you create a Formula Field and populate it with the value of the Start and End times, you can then access the Formula Field via the API.  That works for me!