newbie Relationship question

When I add an asset, I need to initialize the owning Tenant, which comes from the user.
Each user as a “current_tenant”.

Here is my working code.
Had to break it into two steps - couldn’t figure out the syntax to do it it a single line.

How would I do this in 1 statement ?
Thx

    let the_tenant = await user.current_tenant();
    view.asset.ps_tenant(the_tenant) ;
1 Like

2 options

 // Using the object
 view.asset.ps_tenant(await user.current_tenant())
 // OR - using the relationship ID (aka foreign key)
 view.asset.ps_tenant_id = user.current_tenant_id  // NB, we use kinda hidden rel_name_id text field