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
YashhYashh 

Help on validation rule

Hello Guys
i have some requirment that there is one user ABC so if he login when he go to Quote object if that Status (picklist)is draft so he can  only edit only CollectioNumber_c(picklist) if other field  he ediit its show  should show error.
i want to do though validation ruleUser-added image
Best Answer chosen by Yashh
CharuDuttCharuDutt
HIi Yashh
Try Below Validation Rule
However You Have Add Each Field That You Don't Want That User To Edit
AND(
$User.FirstName = 'ABC', 
ISPICKVAL(Status ,'Draft'),
OR(
ISCHANGED(Field_1__c),
ISCHANGED(Field_2__c),
ISCHANGED(Field_3__c)
)
)
Please Mark It As Best Answer If It Helps Thank You! 
 

All Answers

VinayVinay (Salesforce Developers) 
Hi Yash,

Try below snippet.
AND(NOT(ISPICKVAL(Status ,'Draft')),ISCHANGED(CollectioNumber_c))

Please mark as Best Answer if above information was helpful.

Thanks,
Marry SteinMarry Stein
AND(
    ISPICKVAL(Status ,'Draft'),
    $User.Id = "InsertUserId", 
    OR(
    ISCHANGED(FieldA),
    ISCHANGED(FieldB),
    ISCHANGED(FieldC),
    ISCHANGED(FieldD),
    ISCHANGED(FieldE),
    ISCHANGED(FieldF),
    ...
    )
)

Quick and Dirty way. You have to put each field in the formula, except CollectioNumber_c
CharuDuttCharuDutt
HIi Yashh
Try Below Validation Rule
However You Have Add Each Field That You Don't Want That User To Edit
AND(
$User.FirstName = 'ABC', 
ISPICKVAL(Status ,'Draft'),
OR(
ISCHANGED(Field_1__c),
ISCHANGED(Field_2__c),
ISCHANGED(Field_3__c)
)
)
Please Mark It As Best Answer If It Helps Thank You! 
 
This was selected as the best answer
ravi soniravi soni
HI Yash,
try following rule. you can update  owner LastName with your owner name and then try.
AND( Owner.LastName = 'soni', NOT(ISPICKVAL(AccountSource, 'Web')), ISCHANGED(AccountNumber) )
let me know if it helps you by marking it as best answer.
Thank you