Make sure to keep primary field in Lookup view – UCI

Recently faced one issue where lookup control was showing as “No Name”, so we are going to discuss steps to solved it.

When I saw this issue, first thing I checked primary field in the parent entity if it contains data or not, but it was not blank. Another strange thing I noticed, as soon as I saved value was coming correctly.

Normally this type of issue occurs if

> Primary field is blank (as by default primary field is displayed in the lookup control)
> If we are setting up lookup using javascript and while setting we are not setting name field.

In this case non of the above condition was true as there was not script involved in setting up lookup field. I also checked the relationship to make sure ti is setup correctly.

After that I thought of looking into lookup view, while looking at lookup field, I noticed there was a different view setup as default. Next I checked field in that view and found primary field was not there, I know all lookup view have primary field by default and we can’t remove that field from lookup view. So I added primary field there and after that I was able to see correct name in the lookup control.

So if you have changed view for the lookup control make sure primary field is there!

Hope it will help someone!
Keep learning, Keep sharing !!

2 thoughts on “Make sure to keep primary field in Lookup view – UCI

  1. Alan S

    Hi HIMBAP, thanks for sharing. Valuable experience. Remember encountered a similar problem before, but that been figured out finally was a script problem.


Leave a Reply to Alan S Cancel reply

Your email address will not be published. Required fields are marked *