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
Rachjy75Rachjy75 

Lock a custom field

Hello Everyone -
 
I've created a Custom Field on an object that displays what user reconciled an expense. How can I lock that field so when the expense is created that it stays as the original user that created it?
 
As it is now the name keeps changing based on what user opens that expense.
 
Thanks!
legacytexasladylegacytexaslady

Here is the formula that I used to lock down a field once it was saved by the user: The field name should be in the colored slot

AND(ISCHANGED(  Targeted_Units__c  ),
$Profile.Name <> "Custom: System Admin")

 

Hope this helps

LibraLibra

I am looking to something where the field on the record is locked when another field on that same record has a certain value.  For example, if status = Approved then the Rate field is locked down.  Can this be done?

I could use what you posted earlier so that the field can't be changed after the record saved but it would be better for our reps if we could do something like above.

 

Thanks for any insight.

BRupholdtBRupholdt
Building on legacytexaslady's post:
 
Keep unauthorized users from changing the status field:
AND(
  ISCHANGED( Status ),
  $Profile.Name <> "Custom: System Admin"
)
 
Lock the Custom Field if the Status = Approved:
AND(
  ISPICKVAL( Status, "Approved" ),
  ISCHANGED(  Targeted_Units__c  ),
  $Profile.Name <> "Custom: System Admin"
)
Lock the Status field or your smarter users will simply change it to something where they can edit the locked field, change the data they want and set the Status back.
LibraLibra
Thank you for reply.  It will be put to good use.
TCAdminTCAdmin
Libra,

You may also want to look at the built in feature of Approval Processes.  It will lock down the record once a user submits it for approval.  Just another option that you may want to concider.