Skip to main content
Luke Chuter ha preguntado en #Formulas

Hi all! Looking for some help with something. I want to create a validation rule so only users on the profile  'Commercial Team' can edit a record if a the picklist value for field 'Primary Type' is 'Commercial Partner' or 'Commercial New Biz'.

 

I currently have

 AND(

$Profile.Name <> 'Commercial Team',

NOT(ISNEW()),

ISPICKVAL( Primary_Type__c , 'Commercial Partner'),

OR( ISPICKVAL( Primary_Type__c , 'Commercial New Biz')

))

 

I want users on other profiles to be able to see the contact details but not be able edit them if the picklist value shows one of the two values under primary type.

But this doesn't appear to be working. Would appreciate any guidance!

3 respuestas
  1. Eric Praud (Activ8 Solar Energies) Forum Ambassador
    22 nov 2022, 9:49

    Hi Luke,

     

    A couple of things:

    Remove the OR statement. It is not in the right place, and it is not needd or it will always give you an error, just have everything within your AND statement.

    Make sure the picklist values you refer to are their API names, not their labels. They can be differnet and formulas only take the API names

    If it still doesn't work, generate a debug log under the name of the user you're testing with, recreate the issue and read the logs to see what the values of each field is at runtime and see why this rule is not triggering

0/9000