Undocumented SOQL Syntax USING LOOKUP

I’ve come across a SOQL syntax which I cannot find any documentation for, and was wondering if anyone knew about it.

SELECT Id, Name 
FROM Contact 
USING LOOKUP Account.ParentContact__c
BIND ParentId = '0010Y00000aXWI7'

I have a lookup field on Account, ParentContact__c, which looks up to the Contact object, and is filtered so that I can only select Contacts related to the Account’s Parent Id.

This query syntax allows me to input any variables which are used by the lookup filter using the BIND variable, and then returns results according to the configured lookup filter (LOOKUP Account.ParentContact__c).

The only reference I can find to the syntax is that it was removed from the winter 15 release, per the release note changes.

Is this documented anywhere? The SOQL reference only talks about USING SCOPE.

(These can be combined: USING SCOPE Everything, LOOKUP Account.ParentContact__c)

Does anyone know any other parts to this syntax? Was this ever released officially by Salesforce, or is it an accident? Does anyone have an original version of the winter 15 release notes which might document this?


The USING syntax didn’t exist in the prior version [Summer ’14, v.31, release 190] and in Winter ’15 [v.32, release 192] the USING syntax was introduced with just the USING SCOPE operation.

The feature probably was deemed not release ready (or similar), but already in the codebase at the time of code freeze.

It’s much less risky, and much less expensive, to remove details about a feature from documentation and make a note that the section was removed than it is to actually remove the USING LOOKUP operation from the SOQL codebase and then have to fully regression test that removal to make sure nothing was regressed.

Should you choose to use it today, you’d be venturing into “not supported” territory.

Source : Link , Question Author : James , Answer Author : Mark Pond

Leave a Comment