Skip to main content

When a model condition for a date field is set to value of field from another model, a SOQL Error is encountered.


An error occurred while attempting to perform the following SOQL query: SELECT Id FROM Contact WHERE (AccountId = '00137000003of14AAA')AND(Birthdate >= 2015-07-30T18:40:06.000+0000) LIMIT 21 Error:value of filter criterion for field 'Birthdate' must be of type date and should not be enclosed in quotes

Steps to reproduce:


  1. Create standard account detail page

  2. Add “Contact” model

  3. Add AccountId condition to contact model from Account model

  4. Add “Birthdate” condition greater than equal to Account model createdate

  5. Preview page picking an error

Expected Behavior

Page displays without error


Actual Behavior

Page generates SOQL error above


Sample Page XML


<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true" tabtooverride="Account">   <models>
<model id="Account" limit="1" query="true" createrowifnonefound="false" sobject="Account">
<fields>
<field id="Name"/>
<field id="CreatedDate"/>
</fields>
<conditions>
<condition type="param" enclosevalueinquotes="true" operator="=" field="Id" value="id"/>
</conditions>
<actions/>
</model>
<model id="Contact" limit="20" query="true" createrowifnonefound="false" adapter="" type="" sobject="Contact">
<fields/>
<conditions>
<condition type="modelmerge" value="" field="AccountId" operator="=" model="Account" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="noquery"/>
<condition type="modelmerge" value="" field="Birthdate" operator="gte" model="Account" enclosevalueinquotes="false" mergefield="CreatedDate" novaluebehavior="noquery"/>
</conditions>
<actions/>
</model>
</models>
<components>
<pagetitle model="Account" uniqueid="sk-3U2WW-67">
<maintitle>
<template>{{Name}}</template>
</maintitle>
<subtitle>
<template>{{Model.label}}</template>
</subtitle>
<actions>
<action type="delete"/>
<action type="clone"/>
<action type="share"/>
<action type="savecancel" window="self"/>
</actions>
</pagetitle>
<basicfieldeditor showsavecancel="false" showheader="true" model="Account" mode="read" uniqueid="sk-3U2WW-68">
<columns>
<column width="50%">
<sections>
<section title="Basics">
<fields>
<field id="Name"/>
</fields>
</section>
</sections>
</column>
<column width="50%">
<sections>
<section title="System Info">
<fields>
<field id="CreatedDate"/>
</fields>
</section>
</sections>
</column>
</columns>
</basicfieldeditor>
</components>
<resources>
<labels/>
<css/>
<javascript/>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</skuidpage>

Hi, Barry. Contact.Birthdate is a DATE field while Account.CreatedDate is a DATETIME field. I just verified that this has been the behavior since before Superbank in this scenario. It’s a potential improvement that we can consider for Skuid, but for the time being, I think this is how it works.


Doh!  I should have paid closer attention to the datatype.  Sorry for the false alarm J, thanks for catching that!


No worries! The field is named CreatedDate after all.


Reply