Can anyone tell me why this isn’t working? From what I can tell, I have followed example exactly as per documentation, but get the below error:
`
i = orm.newCriteria(“Invoice”);
var invoices = i.eq(‘orgID’,i.convertValueToJavaType(‘orgID’,Application.orgID))
.and(
i.restrictions.ge(‘invoiceDate’,dateHelper.formToCF(arguments.fromDate))
)
.list();
`
ERRO
` Error Type: Template : [N/A] Error Messages: Invalid CFML construct found on line 70 at column 34.
ColdFusion was looking at the following text:
and
The CFML compiler was processing:
`
If I remove the .and() method, it runs fine, but when I add another method or restriction [eg .and() or .ge()] I get an error that the method doesn’t exist.
This works fine:
`
i = orm.newCriteria(“Invoice”);
var invoices = i.eq(‘orgID’,i.convertValueToJavaType(‘orgID’,Application.orgID)).list();
`
Anything obvious I am doing wrong to prevent ability to chain criteria?
Is it appropriate to also use .conjunction() by rearranging the criteria a bit? I ran into the same problem on CF9 and wasn’t aware of the $and – so thank you!