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
B2000B2000 

Datepicker Problem-Doesn't Display for All Users

I am using a dummy Opportunity object's closedate to use the datepicker functionality.  I've used this technique (as recommended by JWetzler)  many times without any problems.  However, I have a VF page where the two datepicker fields do not display in some user's screens.  When I login, the VF page displays both datepicker fields.  When I log in as another user, they don't display.  Inspecting the second user's page, it shows <td></td> (i.e. empty) where both datepickers are supposed to be displayed.  The system has a sharing model and the User has full access to the Account and read/write to the Opportunity.

VF Page:

            <tr >
                <td style="font-weight:bold;">
                    <apex:outputText >From: </apex:outputText>
                </td>
                <td >
                    <apex:inputField value="{!stDate.CloseDate}" />
                </td>
                <td style="font-weight:bold;">
                    <apex:outputText >To: </apex:outputText>
                </td>
                <td>
                    <apex:inputField value="{!enDate.CloseDate}"/>
                </td>

            </tr>

Controller:

	public Opportunity stDate			{get;set;}
	public Opportunity enDate			{get;set;}

	stDate = new Opportunity(closeDate = date.newInstance(date.today().year(),1,1));
	enDate = new Opportunity(closeDate = date.today());

 

 

Best Answer chosen by Admin (Salesforce Developers) 
zachelrathzachelrath

You mentioned that the User has full object permissions to the Account and R/W to Opportunity, but does the User have Field-Level access to the Opportunity CloseDate field?

All Answers

zachelrathzachelrath

You mentioned that the User has full object permissions to the Account and R/W to Opportunity, but does the User have Field-Level access to the Opportunity CloseDate field?

This was selected as the best answer
B2000B2000

The user didn't have access to the Opportunity object.  I changed to a custom date field on the Account record.  Thank you.