Facing difficulty in saving a new data after created a new lookup field in User edit screen (ext-user-edit)

Hi,
I need support that I created an ext-user-edit and a new entity (Lines) for a lookup field in the user edit screen. moreover, I created another entity to make data relations between users and the entity (Lines). everything is ok except save data for that user with the picked-up info for him using the lookup field.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/window.xsd"
        class="com.company"
        messagesPack="com.company"
        xmlns:ext="http://schemas.haulmont.com/cuba/window-ext.xsd"
        extends="com/haulmont/cuba/gui/app/security/user/edit/user-edit.xml">
    <dsContext>
        <datasource id="pickedLineDs"
                    class="com.company.entity.PickedUpLine"
                    view="pickedUpgLine-view">
            <collectionDatasource id="pickedLineDc" property="Code"/>
        </datasource>
        <collectionDatasource id="LineDc" class="com.company.entity.Line"
                              view="_local">
            <query>
                <![CDATA[select e from _Line e]]>
            </query>
        </collectionDatasource>
    </dsContext>
    <layout>
        <lookupPickerField id="LineLookupField" optionsDatasource="LineDc" datasource="pickedLineDs" property="Code"/>
    </layout>
</window>

The entity contains all lines that need to be connected to users:
Lines

Another entity Connecting between User and Lines:
PickedUp

The user edit screen:
screen

Many Thanks.

Hi.
Unfortunately, it is hard to understand, what’s happening in your project, how entities related. We will be able to help you if you send us a small sample project along with reproduction scenario that demonstrates the issue.

Regards,
Natalia.