You need to sign in to do that
Don't have an account?
chriscwharris
Read Only fields/data in edit mode
So I have a pretty simple requirement which seems once again impossible in Salesforce. I have a parent and child, when I create the child I want to display a few values from the parent at the top of the form to assist the entry of data in the child, nothing out of the oridnary you would think. Problem is it seems output only fields or emdedded VF pages etc.. disappear when in edit mode!
Any way around this? I want to display a stock level type field on the child so users don't waste time ordering more stock than is available and I don't want them to have to wait until they try to save.
Thanks
Any way around this? I want to display a stock level type field on the child so users don't waste time ordering more stock than is available and I don't want them to have to wait until they try to save.
Thanks
1) Relatively easy: you need to override edit layout with vf page. For flexibility of setting fields for edition you can use field sets.
2) Complex: Use sidebard component javascript trick. On the fly include vf page containing info of parent obj in iframe.
Stock: {!Parent__c.Stock__c }
Which displayed in READ mode but not in edit. I also tried an output field such as
<apex:outputField value="{!Child__c.Parent__r.Stock__c}"/>
Which again displayed in READ but not edit.
So are you saying Fieldsets allow you to show data in READ mode from a parent object?
Thanks
Let me know if issue still exist.
Let me reiterate your issue. There are Read Only fields (profile level access on those fields are Read-Only) and you want to display(using input fields) them in edit layout of the child object.
Well, this has to be done using wrapper class of the extension controller of your VF page.
Below is the code:
Note: dev101__SLASerialNumber__c field is read only for all profiles.
VF Page:
Extension Controller:
Let me know if this helps you in solving your issue.
Thanks again, as I suspected you've not understood my requirement. I do not want read only fields shown in input fields. I have a parent object that has various items of data on it. When creating a child document I want to have a number of items of data from the parent visibile to facilitate the completion of the child fields.
Think of a page with an area at the top that is read only showing data from the parent and a section below that is the editable fields for the child. At the moment I can not find a way to display data from the parent on the child whilst creating/editing the child. I can add formula fields that show when "reading" an existing child record but that doesn't help.
Thanks
You can achieve this through code provided by me.
VF is overriding contact's default new and edit screen. It contains desired input fields from contact. and fields from account objects.
Just try it.
Let me know if this does not help you.