Subquery conditions not working

  • 1
  • Problem
  • Updated 3 years ago
  • Solved
  • (Edited)
Here is the condition definition:



Here is the result of model.soql (which I believe reflects the query that is actually executing?):
SELECT 
HasCompleteAppointment__c,
HasScheduledAppointments__c,
Patient__c,
Patient__r.Name,
(SELECT Signature_Name__c,Signature_Date__c,Signature_Text__c,SignatureData__c,Id FROM Signatures__r  WHERE ((Signature_Type__c = 'MD Medical Chart')) LIMIT 10),
Id 
FROM Patient_Case__c 
WHERE (HasCompleteAppointment__c > 0.0)
AND(HasScheduledAppointments__c = 0.0)
AND(Id not in (
SELECT Patient_Case__c 
FROM Signature__c 
WHERE (((Signature_Type__c = 'MD Medical Chart')))
)
) LIMIT 21
Notice that only the first subquery condition is executing. Any idea how to make all four conditions execute?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
^^bump^^

Really need this to work soon.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
^^bump^^

Can someone look at this today?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
^^
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
I haven't given up on this. Really need a solution!!!
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,490 Points 10k badge 2x thumb
Hey Matt,

Do you know if you user has Field Level security on those fields. Specifically the ones missing from the SOQL query?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Field level security looks fine.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
We've passed this issue around and don't see anything obvious.  Would you mind granting us login rights and sending us the repro information?  (Org ID, Page Name, Model...)

You can send all that to Support@skuidify.com
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Will send right now. Thanks!
Photo of Ben Hubbard

Ben Hubbard, Employee

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

I think the reason that they're being removed from your SOQL query is that neither Long Text or Encrypted fields are allowed in SOQL filters. Is there any way you could populate a different field when the signature is created?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Any thoughts on how to do that? Should I just do it in the custom component definition? Apparently you can't use encrypted text fields in workflow rule criteria, either!
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,490 Points 10k badge 2x thumb
When you create the signature object, just set some other fields on that object as well that you could use in your query. Do you have control of the code that creates the Signature object?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Yes, I wrote the code for the custom component.

If I add a boolean field to the object called SignatureExists__c, does that field have to be in the skuid model for me to use
model.updateData(row, {SignatureExists__c: true});
?

Or can I use that even if I don't have the field in the skuid model?
(Edited)
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Also... is there a good way to update all the existing rows in my data? Currently the SignatureExists__c field will only be useful for newly created rows in the Signature object...
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,490 Points 10k badge 2x thumb
Yes, the field needs to be in your model for updateRow to work properly.

I wouldn't say there's a "good" way. If it's less than a couple thousand rows, you could write Anonymous apex. If it's more than that, you'll probably need to write a batch apex script.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Less than a thousand rows, actually. I just did it manually with a skuid table. :)
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
It works! Thanks for the help, Ben!