Dropdown list defaults to User

Ask your questions here.
Post Reply
User avatar
Schelle
Posts: 28
Joined: 14 Sep 2023, 03:05
Name: Schelle Ticka
Location: Brisbane Australia

Dropdown list defaults to User

Post by Schelle »

Hi Everyone,

I am unsure how to explain this, but I will give it a go.

I have an entity called Locations, with a sub- entity called Departments, there is no user field in either entity, but there are Location and Department fields in the User entity.

EXAMPLE:
Location A with Department 1 and Department 2
Location B with Department 3 and Department 4

QUESTION: Each user is assigned to a Location and one or more Departments for that location, but when they add a record they see the full list of Locations in the dropdown list for the record, is there a way so they only see the locations they are assigned, for example, default it to the user's location?

When I try and do record visibility on the Location entity, it doesn’t give me the option of User Location.

Thank you in advance
User avatar
support
Site Admin
Posts: 6222
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Dropdown list defaults to User

Post by support »

Try to use Entity drop-down list (ajax) where you can set own condition for dropdown
https://docs.rukovoditel.net/index.php? ... _condition
In condition you can use [current_user_id] for current logged user.
User avatar
Schelle
Posts: 28
Joined: 14 Sep 2023, 03:05
Name: Schelle Ticka
Location: Brisbane Australia

Re: Dropdown list defaults to User

Post by Schelle »

Thanks Sergey, I will give it a try :-)
Post Reply