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
Priya_MarupudiPriya_Marupudi 

Make a field editable through validation rule

Hi everyone,

 

I need to make two fields Field1 and Field2 editable only for a profile called Profile1 when the account number is null. Can I do this using a validation rule? Please advise.

JBabuJBabu

Hi,

 

One option I can think of is, to have a visual force page with two sections.

One layout need to be displays Field1, Field2 as editable for Profile1 when account number is null (u can handle this display through rerender atrribute)

Other layoout needs to be displayed if it doesnot satisfy the above condition.

I am not sure if there is any other easier method to do this.

 

Thanks,

Babu.

JFraileJFraile

Hi.

 

You could try something like this:

1.- Set Field1 and Field2 to 'Read Only' for every Profile but for Profile1.

2.- Create a validation rule like: (ISCHANGED(field1) || ISCHANGED(field2)) && AccNumber != null

Priya_MarupudiPriya_Marupudi

This worked for me using validation rule. I made the two fields editable for profile1 and limited edit access if account number is present.

AND( $Profile.Name = "Profile1", AccountNumber <> "", OR(ISCHANGED(Field1 ), ISCHANGED( Field2 ) ) )

AshishyadavAshishyadav
how you did Iam not able to do this ... its not working for me