Error:expecting a colon, found ')' - Condition on null model date field

I’m receiving this Skuid error: Error:expecting a colon, found ‘)’. I’ve narrowed the issue down to the condition where one model date field is compared to the value of another model’s date field. The error is only displayed when the ‘value’ model date field is null. This was not an error received before upgrading to Banzai. Any ideas?

You can see the very last condition in the SOQL is CheetahBMS__Out_Date__c <= ), I’m assuming that’s the problem.

An error occurred while attempting to perform the following SOQL query: SELECT SUM(CheetahBMS__Quantity__c) AggQuantity,MAX(CheetahBMS__Product_Group__r.Name) maxCheetahBMSProductGroup,CheetahBMS__Product_Group__r.Id ProductAggId FROM CheetahBMS__Order_Line__c WHERE (CheetahBMS__Status__c != ‘Checked In’)AND(CheetahBMS__Status__c != ‘Checked Out’)AND(CheetahBMS__Product_Group__r.CheetahBMS__Consumable__c = false)AND((CheetahBMS__In_Date__c = null)OR(((CheetahBMS__Out_Date__c <= 2015-10-02T05:00:00.000+0000)AND(CheetahBMS__In_Date__c >= 2015-10-02T05:00:00.000+0000))OR((CheetahBMS__Out_Date__c >= 2015-10-02T05:00:00.000+0000)AND(CheetahBMS__Out_Date__c <= )))) GROUP BY CheetahBMS__Product_Group__r.Id Error:expecting a colon, found ‘)’

Do you have a specific condition for that last statement?  If so,  I’m guessing you didn’t select the “is Blank” option in the values section. 

Not sure what you mean. The last condition is below. It has a value defined by a model.

This error only pops up when the In Date field is blank on the Reservation model.

Hi Craig, this looks like a bug to me, I’ll take a deeper look and let you know.

Confirmed, this is a bug with how Skuid handles null values on date fields in model merge conditions. I’ll keep you updated.

Thanks Ben. We use these conditions pretty frequently so please keep me updated. I don’t believe we experienced this problem previously under older versions of Skuid if that helps at all.

Will do. I don’t think it’s going to make it in the patch that’s going out today. But i’ll try to get it fixed in the next one.

Is there a way to temporarily hide the error with CSS? I can hide the .nx-error in my dev console and that works, but for some reason I can’t find the right way hide it using CSS in my Skuid page. 

This should be fixed in Banzai Update 4. Which will be available on the www.skuidify.com/skuidreleases page either later today or tomorrow.

Ben,

I’m running 7.20 and getting a different error but for the same scenario.

  1. An error occurred while attempting to perform the following SOQL query: SELECT SUM(CheetahBMS__Quantity__c) AggQuantity,MAX(CheetahBMS__Product_Group__r.Name) maxCheetahBMSProductGroup,CheetahBMS__Product_Group__r.Id ProductAggId FROM CheetahBMS__Order_Line__c WHERE (CheetahBMS__Location__c = ‘’)AND(CheetahBMS__Status__c != ‘Checked In’)AND((CheetahBMS__Status__c != ‘Checked Out’)AND(CheetahBMS__Product_Group__r.CheetahBMS__Consumable__c = false))AND((CheetahBMS__In_Date__c = null)OR((((CheetahBMS__Out_Date__c <= 2015-02-06T06:00:00.000+0000)AND(CheetahBMS__In_Date__c >= 2015-02-06T06:00:00.000+0000))OR((CheetahBMS__Out_Date__c >= 2015-02-06T06:00:00.000+0000)AND(CheetahBMS__Out_Date__c <= null))))) GROUP BY CheetahBMS__Product_Group__r.Id Error:invalid operator

Not sure what the invalid operator is, I didn’t see anything. Any ideas?

Ok, it looks like the problem is here…

CheetahBMS__Out_Date__c <= null

SOQL doesn’t like doing greater than / less than operators on null. What would your desired behavior be in this case? Would you want that condition to evaluate to true or false?

False, I think. Let me walk you through the logic just to make sure. That last condition compares the Out Date of the record being queried to the In Date of the current record.

If the reservation is a sale, it will have no In Date, i.e. the products are not coming back. This model is looking for other Orders that might conflict with this reservation. So it doesn’t matter to look for reservations who might start before this one “comes back in”, because its not coming back in.

Hmmm, I think for now, you might need to make a formula field to solve this. Basically, have your formula just return the date unless it’s null, if it is null, return a date far in the past (or future).

That seems like a viable workaround for now. However, I have not been able to make this work. I think there might be a bug with the datetime ui-only formula fields. 

I have a Ui only formula field with return type datetime. The formula is set to {{CheetahBMS__In_Date__c}}. It is not returning anything. When I change the return type to text, I get “2015-04-03T05:00:00.000+0000”. I think that’s a SF date, right? Or is it converting to JS and needs to be converted back?

Sorry, I should have been more explicit. You’ll have to use a Salesforce formula field. UI-Only fields aren’t created until Skuid is running in your browser. These conditions are actually calculated in Apex. Unfortunately, you can’t use merge syntax in model conditions.

I understand needing to use the Salesforce formula field for the model condition purpose, but I was still having an issue with the Ui only field displaying a datetime when being fed directly a salesforce datetime. 

Ok, I get it now. I found a bug with this. I’ll let you know when it’s fixed.

Awesome, thanks. By the way, the Salesforce formula field worked perfectly to remove the error.