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
Kumar5Kumar5 

need help with validaiton rule

Hi Team,

Could you please help me with below validation rule. i have to want inlcude two user ids..


AND(
RecordTypeId == $Setup.ObjectRecordTypeIds__c.Case_RecordType__c,
LEN( Subject) >250,
OR(
ISNEW(),
ISCHANGED(RecordTypeId)
),
!AND(ISNEW(), RecordTypeId == $Setup.ObjectRecordTypeIds__c.Case_RecordType__c,ISPICKVAL (Contact_Type__c , 'employee'), $User.Id = '0058000000', $User.Id = '0053000000'),
skipValidations__c = False
)

Thanks,
Kumar
Best Answer chosen by Kumar5
RKSalesforceRKSalesforce
Hi Kumar,

You can try adding OR condition for userId's:
AND(
RecordTypeId == $Setup.ObjectRecordTypeIds__c.Case_RecordType__c,
LEN( Subject) >250,
OR(
ISNEW(),
ISCHANGED(RecordTypeId)
),
!AND(ISNEW(), RecordTypeId == $Setup.ObjectRecordTypeIds__c.Case_RecordType__c,ISPICKVAL (Contact_Type__c , 'employee'), OR($User.Id = '0058000000', $User.Id = '0053000000')),
skipValidations__c = False
)

Pls let me know if helped.

Regards,
Ramakant

All Answers

RKSalesforceRKSalesforce
Hi Kumar,

Though your question is not clear. I think you are putting wrong User.Id, It should be 15 digit.
Please let me know if helped.

Regards,
Ramakant
Kumar5Kumar5
Hi Ramakant,

Thank you for your reply. 

Previously the same validaiton rule  is there for one user id. now i want to add one more user id. Just for reference i gave that user id

Thanks,
Kumar
RKSalesforceRKSalesforce
Hi Kumar,

You can try adding OR condition for userId's:
AND(
RecordTypeId == $Setup.ObjectRecordTypeIds__c.Case_RecordType__c,
LEN( Subject) >250,
OR(
ISNEW(),
ISCHANGED(RecordTypeId)
),
!AND(ISNEW(), RecordTypeId == $Setup.ObjectRecordTypeIds__c.Case_RecordType__c,ISPICKVAL (Contact_Type__c , 'employee'), OR($User.Id = '0058000000', $User.Id = '0053000000')),
skipValidations__c = False
)

Pls let me know if helped.

Regards,
Ramakant
This was selected as the best answer