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
NakataNakata 

Parameter not populate to read-only field

Good day,

 

I working on controller, which pass parameter via URL to a custom object detail page's fields.

 

for instance :

 

Controller :

String accountMember = 'user1';

String accountMember2 = 'user2';

 

String URL = /a03/e?xxx111=accountMember&xxx222=accountMember2;

 

Custom object:

xxx111 is field id of accountMember and belong to text field type

xxx222 is field id of accountMember2 and belong to text field type

 

Problem :

accountMember fields are both read-only suppose, i do not see my parameter populate in fields until i make the field to visible on FLS

 

question :

1. why the readonly field can't get the parameter ?

2. if i make the fields to visible now, how can i make the fields not editable ? i try using validaton rule with formula 

isChange(accountMember__c) , it doesn't prevent user to edit before it get save, the validation only check after the record saved, any hint on this ?

 

Thanks!

 

Ankit AroraAnkit Arora

You can do one thing, make field read only on page layout. Also make same field visible and not read only on profile level. So by this your field can not be updated by UI and can be updated from code.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

wmiriyewmiriye

That does not work. Have a similar situation and tried your suggestion. Any other ideas?