+ Start a Discussion
Big EarsBig Ears 

Read-only "Look-up" field. Is it possible?

I want to have a read-only look-up field in my instance of Salesforce. However, whenever I build one, they either seem to be invisible to all, or editable.
 
I want a Read-Only Look-up field is so I can update it later using some behind-the-scenes APEX coding as part of the sales & contracting process. I just don't want people to be putting information in that field before they're supposed to.
 
Does anybody know if Salesforce doesn't allow for Read-Only Look-ups? I'd understand why.
 
Thanks for your help!
 
Andy
Nathan CrosbyNathan Crosby
You can have read-only lookups on an object. You can control this either through field-level security or on the page layout itself.

To use field-level security, click on the field name within the object settings and click the Set Field-Level Security button. Here you will be able to control by profile who can view the field, and for those who can view it, control if the field is read-only or not.

You also have the ability to make a field read-only on page layouts. From the page layout edit screen, double-click the field you want to make read-only and there will be a read-only option via a checkbox.

You'll be able to control these lookups via an APEX trigger in the background - sounds like what you're after.
Marc C.Marc C.

"You also have the ability to make a field read-only on page layouts. From the page layout edit screen, double-click the field you want to make read-only and there will be a read-only option via a checkbox."

 

The read-only checkbox is greyed out on lookup fields inside the layout. Is this maybe because the field is mandatory? We'd like to have the field set only by the system once at creation (to make a multi-level master-detail relationship) but not changed.

James BengelJames Bengel
Have you explored using a formula field to handle the display chores, rather than trying to use the lookup field itself on the page?  Formulas are by definition read-only, so it seems like it would do what you're after.