0

I am trying to use this formula for a WorkFlow but Salesforce keeps giving me errors about two fields which are picklists. Anyone know what I am doing wrong?

This is the code and the error is below...

(GW_Volunteers__Start_Date__c >=  TODAY() +2)
&&
(ISPICKVAL(GW_Volunteers__Status__c, "Confirmed"))
&&
( ISPICKVAL( GW_Volunteers__Volunteer_Shift__r.GW_Volunteers__Volunteer_Job__c, "Recurring Shift Job" ))
&&
  (GW_Volunteers__Contact__r.Email <> "")

The error message:

Error: Incorrect parameter type for function 'ISPICKVAL()'. Expected Picklist, received Lookup(Volunteer Job)

  • 1
    it means the field GW_Volunteers__Volunteer_Job__c is a lookup field and you cannot use ISPICKVAL function on this field. – Vamsi Krishna Dec 1 '14 at 10:55
  • Ok. As you can see, I am trying to determine if a particular value was selected in picklist. How to do it? I tried it without ISPICKVAL and it told me that it's a pick list that is why I used that function. BTW, it really is a picklist consisting of 4 values. The error I get isn't correct. Thanks – sf123 Dec 1 '14 at 17:50
2

I assume this is on the Volunteer Hours object in the Volunteers for Salesforce package?

Looking at the Volunteer Shift object, the Volunteer Job field (GW_Volunteers__Volunteer_Shift__r.GW_Volunteers__Volunteer_Job__c) is in fact a Master-Detail relationship field, not a picklist. It may be getting rendered in the UI as a picklist, but in the schema, it's a lookup. So I think your formula needs to be:

(GW_Volunteers__Start_Date__c >=  TODAY() +2)
&&
ISPICKVAL(GW_Volunteers__Status__c, "Confirmed")
&&
GW_Volunteers__Volunteer_Shift__r.GW_Volunteers__Volunteer_Job__r.Name  = "Recurring Shift Job"
&&
GW_Volunteers__Contact__r.Email <> ""

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.