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
Sumit Vakil.ax1203Sumit Vakil.ax1203 

Task Validation Rule error: Expected Object, received Number

Hi,

I have searched the boards but haven't found an answer to this problem I have run into.

 

I have a custom object called PrqData__c with a Number field called rVal__c. I want to write an Activity Task Validation Rule for this field (Settings -> App Setup -> Activities -> Task Validation Rules). But when I try the following, I get an error "Expected Object, received number".

 

$ObjectType.PrqData__c.rVal__c > 10

 

What am I doing wrong? This is a simple enough formula. Not that it should matter, but I am using "Insert Field" and "Insert Opeartor". And the __c are correct; __r don't work.

 

Thanks,

 

Sumit

jd123jd123

Hi

Try this one. I am not getting what you are exactly excepting

PrqData__r.rVal__c > 10

Sumit Vakil.ax1203Sumit Vakil.ax1203

Hi,

That doesn't work.

 

Let me try and explain what I am doing. I have a workflow rule that checks if a rVal__c is greater than 10. If it is, an Activity / Task is created automatically and assigned to some user. When the user marks the Task complete, I want to run a Task Validation rule that checks that the user marks the task complete only after setting rVal__c to less than 10. That way, I am ensuring that the user is actually resolving the problem before marking the Task complete.

 

To set up a Task Validation Rule, I go to Setup -> App Setup -> Task Validation Rules. In the Error Condition Formula box, I use the "Insert Field" button to click my way to $ObjectType.PrqData__c.Fields.rVal__c > 10. The resulting syntax conforms to the examples here: http://na9.salesforce.com/help/doc/en/fields_useful_field_validation_formulas.htm. See the second example labeled "Billing Zip Code Is in Billing State".

 

I have tried all possible combinations with and without the $ObjectType and Fields. I have tried __r, __c etc. but nothing works. With the syntax recommended by the above URL, I get the following error message:

 

Error: Incorrect parameter for operator '>'. Expected Object, received Number

 

Thanks,

 

Sumit