- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-01-2024 10:30 AM
I want to show related lists "My Employees" for current user record (who is their manager). Also I want only the current record user to only be able to create new record from the related list.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-01-2024 10:45 AM
Hi @Ubada Barmawar,
Create a relationship record 'My Employees' which applies and queries from user table. Use the following query:
current.addQuery('manager',parent.sys_id);
This will create a related list which you can add from Configure > Related Lists (slushbucket).
You can use list control for this related list from Configure (Right click on any related list column) > List Control to use omit new condition. Use following script for omit new condition:
var currentUser = gs.getUserID();
var recordUser = parent.sys_id;
if (recordUser == currentUser) {
answer = false;
} else {
answer = true;
}
If you found this reply useful, please mark it as solution and helpful.
Thanks and Regards,
Ehab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-01-2024 10:40 AM
Hi @Ubada Barmawar ,
Could you please explain your requirement in detailed way may be with some screenshot and the table on which you want to create RL ?
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-01-2024 10:45 AM
Hi @Ubada Barmawar,
Create a relationship record 'My Employees' which applies and queries from user table. Use the following query:
current.addQuery('manager',parent.sys_id);
This will create a related list which you can add from Configure > Related Lists (slushbucket).
You can use list control for this related list from Configure (Right click on any related list column) > List Control to use omit new condition. Use following script for omit new condition:
var currentUser = gs.getUserID();
var recordUser = parent.sys_id;
if (recordUser == currentUser) {
answer = false;
} else {
answer = true;
}
If you found this reply useful, please mark it as solution and helpful.
Thanks and Regards,
Ehab