Snippet for Custom Field Renderer as Lookuip

  • 1
  • Question
  • Updated 4 years ago
I have found some good examples of creating a Custom Picklist from a Model:

A drop down list from a custom setting
Custom picklist renderer when option source is a model

But my wanton appetite is on the lookout for a version for Lookups. Taking the same idea, a Model for the source data, instead of a Picklist, I want to render a Lookup. 
Photo of Ross James

Ross James

  • 490 Points 250 badge 2x thumb

Posted 4 years ago

  • 1
Photo of Moshe Karmel

Moshe Karmel, Champion

  • 8,646 Points 5k badge 2x thumb
I don't know what your intended result is, but it sounds like you can use the lookup filters that exist on reference fields.

I didn't know they existed for 6 months but now I use them like crazy.
Photo of Ross James

Ross James

  • 490 Points 250 badge 2x thumb
Thanks Moshe, but I am looking for how to do this for non-reference fields. The two examples above show how to create picklists from 'normal' fields, I want to do similar, but as a lookup.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Ross  - to be clear,  you would like to have a picklist field rendered so that it looks like a reference field lookup?  (Essentially presenting a type ahead field?).   Is that what you are after ?
Photo of Ross James

Ross James

  • 490 Points 250 badge 2x thumb
Close, but I want to use a 'normal' text field, like in the two examples I gave. They both give a picklist that the selected item used to populate the text field. I wish to do something very similar, but with a lookup or type ahead.