Probability field, filter problem

  • 2
  • Problem
  • Updated 4 years ago
  • Solved
I have a question about a problem I am running into with a page I am trying to make. It appears I can not include the "Probability" field in a conditions query. My goal is to exclude any records who's probability is marked as either 0% or 100%.
Here is how I am setting the condition:

and this is the error message I am getting:
1. An error occurred while attempting to perform the following SOQL query: SELECT Id,RecordType.Name,RecordTypeId,Event_Date__c,Point_of_Contact__c,CloseDate,Proposal_Submitted_Date__c,Contract_Amount__c,StageName,Project_Name__c,Account.Name,Name FROM Opportunity WHERE ((RecordType.Id = '012700000005pp8')AND(StageName not in ('Contract Accepted','Completed/Paid in Full','Proposal Denied','Proposal Submitted'))AND(Probability in ('0%','100%')))OR((StageName not in ('Contract Accepted','Completed/Paid in Full','Proposal Denied','Proposal Submitted'))AND(RecordType.Id = '01270000000E1wr')AND(Probability in ('0','100'))) LIMIT 21 Error:value of filter criterion for field 'Probability' must be of type double and should not be enclosed in quotes
There is nothing I can do about quotes as they are automatically put in by the query generator. Is this a bug / something I will have to wait to get fixed? or am I doing something wrong here. Any help is appreciated!
Photo of Colin Worf

Colin Worf

  • 92 Points 75 badge 2x thumb

Posted 4 years ago

  • 2
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,490 Points 10k badge 2x thumb
Hi Colin,

This looks like a bug with creating conditions based on percentage fields and will be something we have to fix on our end.  In the mean time, I would suggest creating a formula field of type "Number", "Text", or "Checkbox" to work around for now.
Photo of J.

J., Official Rep

  • 7,470 Points 5k badge 2x thumb
Colin,

In the meantime, you can get around this bug if you are willing to do a little XML editing. Open up your page in the Page Builder (Save or Cancel if it's currently open and you've got some unsaved changes), then click on the "View/Edit XML" link in the lower right hand corner (tutorial, for reference). Once that page loads, look for you Condition on Opportunity.Probability, which should look something like this:
<condition type="multiple" value="" field="Probability" operator="not in" enclosevalueinquotes="true">
 <values>
  <value>0</value>
  <value>100</value>
 </values>
</condition>
You need to change the value of the "enclosevalueinquotes" attribute to "false" and Save. Note that if you then change anything about this Condition in the builder, this attribute may revert back to "true," but I've verified that this does get around the issue in the latest version of Skuid (and likely in previous versions as well).
Photo of Colin Worf

Colin Worf

  • 92 Points 75 badge 2x thumb
Awesome! I didn't realize I could edit XML. Thanks for the workaround.
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
We have fixed this in Skuid core, and the fix will be made available as part of our Summer 14 release (coming by late July).
Photo of John De Santiago

John De Santiago

  • 736 Points 500 badge 2x thumb
I am having similar issues as the one described in this thread. Held off testing till now. Installed Summer 14 in a sandbox and tested this out to see if the issue is resolved and the error still occurs. I am using a table filter with manual values mapped to conditions on the controller. Is there anything specific I need to do to correct this error or has it not been addressed yet in this release?
Photo of J.

J., Official Rep

  • 7,470 Points 5k badge 2x thumb
John,

I just attempted to replicate the Opportunity.Probability Condition of the original post in a newly installed Summer 14 org and did not get the error. However, the bug fix only applies to new and (in some cases) updated Skuid Model Conditions. If the specific Condition you are using for testing existed before Skuid Summer 14 was installed, try changing the field to something other than that percent field, then change it back (or just recreate the Condition, if you like). We don't rebuild the XML automatically, lest we wipe out any direct XML modifications you may have put in place.

Does that get it working for you? If not, we may need to take a closer look.
Photo of John De Santiago

John De Santiago

  • 736 Points 500 badge 2x thumb
Thanks, I finally got around to trying this out again and I just had to recreate the filter criteria and that got it to work. 
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Glad you got it to work!  Thanks for letting us know...