3

I have a custom lwc that isn't directly linked to an object instance.

On this lwc, I would like to use the lwc lookup input to lookup a related object and get its id.

I'm struggling to do this, as it seems that lookup fields require either a new object or an existing object instance to work.

Is there anyway to use this lookup field without modifying or creating new object?

2 Answers 2

3

As you've observed, the built-in component needs a record to work with. However, there are open source versions (try searching for "lwc lookup field github") that you could modify to work without a record.

2

You can also check out an alternative lookup component (more lightweight) here. It's not exactly what you are looking for but you can iterate and extend this component for a related object.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .