I would like to limit the lookup field to only show the currently logged in user as an option. .
I tried this but it didn’t work for me -
<collection id="requestedBySelectorDc" class="com.company.sample.entity.ExtUser" view="_minimal">
<![CDATA[select e from sec$User e where e.email = :userLogin]]>
I think you almost finished what you were trying to do. You forgot to set the parameter in the dataloader object. Take a look at this sample.
I don’t know your application usage scenario, but it seems a little strange to use a lookup field with only one possible value. If this “Requested By” should always be set to the logged user when a new item is created, I would suggest you to change this field to a readonly TextField and set this value when a new item is created.
By the text of the error, you don’t have a method called setRequestedBy(User) for the class SafeRequest. Also, according to the screenshot that you attached from the CUBA entity designer, the name of the field is the requestSubmitedBy, which means the method should consist of this name - setRequestSubmitedBy(User).
THANK YOU - The issue was partly with my onInitEntity code like you suggested @durygin. The issue also turned out to be my view. For the Extended Users Requested By i had the View in the viewset to user.browse. I changed it to Minimal and everything loaded as @peterson.br
Thank you both very much. I really appreciate your help.