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
Developer129Developer129 

Prepopulate Readonly field on edit form

Hi,

 

Is there a way to prepopulate and show a read only field on the new/edit form (where the data is entered for the record)

 

Thanx

Best Answer chosen by Admin (Salesforce Developers) 
lnryanlnryan

Here are some things that may work based on what I know about similar tasks. (I haven't specifically tested these out so if someone else has an exact solution go with that)

 

- Instead of trying to Override the button in the configuration settings, try removing the button from the page layout. Replace with a new button going to the page. This works for related lists. Not sure about the main tab / list views.

- If you can't pass in the value in your querystring to a universally read-only field. You might try making the field readonly on the page layout instead.  This may open up the underlying permissions while still preventing manual edits.

 

If these don't work, you could, of course, consider a VF page,

All Answers

lnryanlnryan

Do you already know how to pass values in through querystring parameters?

Developer129Developer129

Yes, I do know how to pass values in through querystring parameters however I am unable to override the new button for ticket request and also for readonly field when querystring parameter is passed it does not show up on the new/edit form

 

 

lnryanlnryan

Here are some things that may work based on what I know about similar tasks. (I haven't specifically tested these out so if someone else has an exact solution go with that)

 

- Instead of trying to Override the button in the configuration settings, try removing the button from the page layout. Replace with a new button going to the page. This works for related lists. Not sure about the main tab / list views.

- If you can't pass in the value in your querystring to a universally read-only field. You might try making the field readonly on the page layout instead.  This may open up the underlying permissions while still preventing manual edits.

 

If these don't work, you could, of course, consider a VF page,

This was selected as the best answer
SanchSanch

Hi there,

 

I am trying to do something similar. Can you tell me how you got the field to be just readonly without using a visualforce page?