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
Vijay BirsinghVijay Birsingh 

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

Hello,

       This is the validation rule:

ISPICKVAL( $ObjectType.Agreement__c.Fields.Agreement_Motive__c ,'Location Changed').  Where Agreement_Motive__c is a picklist. I am currently working on Opportunity object. Unfortunately, I am faced with this error:

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

Could you, please, help me with this issue?

I thank you.

Regards, 
Vijay.

Best Answer chosen by Vijay Birsingh
Hitendar Singh 9Hitendar Singh 9
ISPICKVAL( Opportunity_Agreement__r.Agreement_Motive__c ,'Location Changed')

Then you can directly use like above right?

All Answers

Rahul Sangwan7341Rahul Sangwan7341
Hi Vijay ,

You can do as Neetu said:
ISPICKVAL(Agreement_Motive__c ,'Location Changed')

Or 

TEXT(Agreement_Motive__c) == 'Location Changed'

Please Select this as Best Answer if it helps you.
Hitendar Singh 9Hitendar Singh 9
Whether the Opportunity object and Agreement__c are related?
Vijay BirsinghVijay Birsingh

Hello,

        @Hitendar: Yes, Opportunity and Agreement__c are related through the Opportunity_Agreement__c field.

Regards,
Vijay.

 

Hitendar Singh 9Hitendar Singh 9
ISPICKVAL( Opportunity_Agreement__r.Agreement_Motive__c ,'Location Changed')

Then you can directly use like above right?
This was selected as the best answer
Vijay BirsinghVijay Birsingh

Hello,
            @Hitendar: It does work. Thanks!!

Kind Regards,
Vijay.

Fabrizio SigilloFabrizio Sigillo
Hi, i have the same problem but with @Hitendar Singh 9 solution, however it does not work.

test1test2