Date Time Field Value Is Null Check Is Failing
Summary:
We have a field 'DueDate_c' custom field (not indexed)
We are trying to build a newView() query using the below code -
def logger = ""
def now = new Date()
def tenMinAgo = new Date(now.getTime() - (10 * 60 * 1000))
def vo = newView('ServiceRequestVO')
addBindVariable(vo, "startDate", "DATETIME")
setBindVariable(vo, "startDate", tenMinAgo)
vo.appendViewCriteria('(CreationDate >= :startDate) and (DueDate_c is null)')
vo.executeQuery()
while(vo.hasNext()) {
def sr = vo.next()
logger += "Processing SR: ${sr.SrNumber}\n"
}
return logger
I checked the (CreationDate >= :startDate) part and it is working fine but when the 2nd part (DueDate_c is null) is added, I am getting the below exception of failed build criteria. I have tried adding the null check in multiple ways but it did not worked.