0

We are implementing a special type of lookup window in a VisualForce page, which displays a set of potential records a user can select from to populate a Lookup value. As a means to allow users to filter potential selections, we wanted to make use the Lookup Filter properties available when configuring a Lookup field.

The only problem is we don't seem to have any way to dynamically access these filter properties through Apex code. The Describe Field Result does not seem to contain this information, and I haven't been able to find anything in the documentation about it.

Is there no way to access Lookup Filter properties from the Apex Schema methods?

  • No there is not. You might be able to get the Metadata API to work for you. – Adrian Larson Sep 7 '17 at 23:17
  • So short of calling out to some external service, it's not possible. That's what I thought. Thanks for the answer! – zeneto Sep 8 '17 at 16:13
  • 1
    If you want to go offroad, you can use a combination of the undocumented and unsupported USING LOOKUP clause with the SOAP API to build this, which might be a little simpler than accessing the metadata. But it's undocumented so YMMV. You can use the SOAP API Describe call to get the filteredLookupInfo for the field, which tells you the controlling fields for the filter. Using this you can create a query over the target object, binding those controlling fields to the query salesforce.stackexchange.com/questions/192280 – James Sep 18 '17 at 20:54
  • Interesting. Seems like what I need, but there must be a reason they stopped supporting it. Also, if I wanted to dynamically BIND which fields need to be factored into the filter, I don't have a way to retrieve those without additional configuration. I'll keep an eye out to see if they bring it back. Good find. – zeneto Sep 20 '17 at 16:50
0

No there is not. You might be able to get the Metadata API to work for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.