.when() functionality in QuickORM missing

Hi there. I testing upgrading QuickORM in my app from 2.5.3 to latest version (4.2.3). I have the follow that now gives me an error:

return wireBox.getInstance(“pr.” & arguments.pr)
.when(structKeyExists(arguments,“DisclosureID”), function ( q ) {
q.DisclosureID(DisclosureID)
})
.when(structKeyExists(arguments,“SponsorCode”), function ( q ) {
q.SponsorCode(SponsorCode)
}).get()

It gives me the following error:

Type: QuickMissingMethod
Messages: Quick couldn’t figure out what to do with [when]. The error returned was: Method does not exist on QueryBuilder [DisclosureID].

Looking at the version history, it looks like the ‘when’ function was removed in version 3.0.0. Was this an oversight or is the ‘when’ functionality no longer supported?

Thanks in advance,
Byron

when is indeed still there. Quick defers to qb for it now. The error message says it doesn’t know what q.disclosureID is. It says that after the part about an error in when.

Ah. Lightbulb. DisclosureID is supposed to be a queryScope that I have in my entity. Let me check to make sure that is set up correctly.

I found the docs regarding missingMethod and order quick goes through. Makes since to let qb do the work.

Yep. That was it. Had an issue with it finding the scopeDisclosureID.

Thanks for pointing me in the right direction.