Related lists

Ubada Barmawar
Giga Guru

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.

1 ACCEPTED SOLUTION

Ehab Pilloor
Mega Sage

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

 

View solution in original post

2 REPLIES 2

swathisarang98
Giga Sage
Giga Sage

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

Ehab Pilloor
Mega Sage

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