You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

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.

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!