You need to sign in to do that
Don't have an account?
Incorrect parameter, expected Object
Good morning,
Trying to create a validation rule pulling from the Case object as well as two custom objects (Agency Input Task and Collaboration Task)
(ispickval (Status, "Resolved") || ispickval(status, "Closed") || ispickval (status, "Denied")) && ($ObjectType.Agency_Input_Task__c.Fields.Completed__c = false) || ($ObjectType.Collaboration_Task__c.Fields.Completed__c = false)
so basically if either an Agency Input Task or Collaboration Task is not complete (marked by a checkbox)(boolean) then the Case cannot be resolved/closed/denied.
But the fields from the custom objects seem to be returning an error:
Incorrect parameter for operator '='. Expected Object, received Boolean
does anyone know how to correct this?
thanks
I don't think you can traverse relationships to other objects in validation rules.
You can't use $ObjectType this way. Traverse the relationships by going through the relationship names (__r instead of __c, and see documentation or system UI for standard fields).
Your code should probably look something like this:
Use Case for multiple values on a selectbox that should be one of several values. Better performance, less code space used. Switched A || B to !(A && B), slightly better comparison rate, and better reflects your logic (this says that only when both boxes are checked, would the result be allowed). " = true" and " = false" is not necessary for checkboxes; simply use their name for true, or NOT(fieldname) for false.
Let me know if that fixes your problem.
thanks for your help. Still gettingan error on the custom object, :
(NOT(OR(Agency_Input_Task__r.Completed__c, Collaboration_Task__r.Fields.Completed__c )))
stating that the field Agency_Input_Task__r does not exist. (Agency_Input_Task__r is the custom object, Completed__c is a field on the object)....
any suggestions would be apprciated..
Use the insert field button to get the correct name. Agency_Input_Task__r is the name of the custom field that points to your object, not the object's name.