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
anjuanju 

Toggle Date field in New Page.

Hi,
 
I have a date type field namely "Start Date". In New  page Start Date should be editable.
And in Edit Page Start Date should be read only.
 
We can't able to do it from page layout because for New, Edit and View page layout is same.
I tried to use a scontrol to create Start Date field. But that scontrol(by default) will be called only in View mode not in new and edit mode.
 
Do I need to override New button for that? Or is there is any other way to do it?
Please help me if anybody has any idea.
 
Thanks in advance
 
 
 
 
kfosskfoss
You could place your sControl in an IFrame in the left nav frame that can look for your field in the main content and change it to read-only as needed.
 
Look for "Field Level Help" by sfdcfox in this board and you can see how this could work.  The advantage here is that the sControl is always called.
KaushikKaushik
The simpler way to solve this problem would be to use validation rules, available in Salesforce.com.

Although using this , the Start Date would appear as a field in the edit mode,the validation rule setting would prevent the record to be saved if the there is any change in the Start Date.

PRIORVALUE( Start_Date__c ) <> Start_Date__c


Kaushik


anjuanju

Hi,

Thanks Foss. But from where I will get the "Field level help" Doc?Culd you give me the path.

 

anjuanju
Thanks a lot Foss.