Issue:
Restict the lead record opening if the sales team member doesn’t have the current user as a member.
Solution
The issue was due to the saved search criteria.
for the lead record they have enabled the sales team.
in a sales team there can be multiple members
when you use the saved search normal criteria instead of the summary criteria then NetSuite filters out a single sales team member line and will display the remaining sales team member and use it for computation.
so the requirement would be to consider all the sales team members together and then evaluate and see if the employee should be able to view the lead record or not instead of individually considering a single team member for computation
so due to this requirement we have removed the standard criteria and added the same in the summary criteria of saved search so in the summary criteria we have added such a way that if any of the sales team members is the user then set it to one else set it to 0 and the summary function used this maximum so in this case when we evaluate NetSuite consider all team members of that lead and then the maximum will be one or zero depending upon if the user is true.