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

Lookup Problem

Hi All,


Trying to create a validation rule for tasks.


I have a picklist field called Type that has multiple values and another field called Name that is a lookup for accounts. 


The rules is for users when they select Type picklist value "Sales Meeting Call", Name has to be filled with a lookup.


But when I'm creating the rule, in the Insert Field option the lookup field is not visible?




Best Answer chosen by Admin (Salesforce Developers) 

Hi Richard,


This should work. Let's say you have 2 objects: ObjectA and ObjectB, where ObjectA has the Type field and a lookup field to ObjectB. With that, this should be the formula in the validation rule on ObjectA:


IF( ISPICKVAL( Type__c , "Sales Meeting Call") , ObjectB__c = "", ObjectB__c <> "")


Hope that helps,