because I’m not yet assigned user for join many team.I think we’re need modify both UserSetup Table and Team Table…but is it can be ? If user have enough data we’re can filter by your suggest…until now they’re just have 01 team in record.
I think that trying to force this solution into the User Setup table is making it harder than it needs to be. The cleanest way to do it in my opinion is also the more standard approach for representing many-to-many relationships.
In your situation, you have many users and many teams. If it were not possible for a user to be on more than one team, then putting the solution in the User Setup table would be acceptable. But, since users can be on more than one team, you need to take a different approach.
You already have your user date in either User or User Setup (your choice.) You need to create a list of available teams in a lookup-type table. I’d call it Team, with two fields, Code10 (Primary Key) and Description (Text30-50). This is just a list table. Then, you’ll create a table called User Team in which you will establish relationships between users and teams. This table would need at least two fields - User Code, and Team Code. You could add flowfields for each of those two fields as well so you can clearly see which user is on what team when you display the User Team List form.
Now that you have the data in the optimal format, when you run your report you only need to filter the User Team table by the User Code to know which teams the user belongs to. From there, you can decide which menu options to show him on the request form. If you think about it, you’ll see that you can use the User Team table in this way to allow the user to chose which team to run the report for rather than trying to manipulate an option list.
IF team1.FINDFIRST THEN
BEGIN
team1.VALIDATE(“Salesperson Code”, SalemanFilter);
TeamFilter := FORMAT (team1.“Team Code”);
TeamFilter2 := FORMAT (team2.TeamCode2);
setteam.SETFILTER(“Team Code”,’%1’, TeamFilter);
setteam2.SETFILTER(TeamCode2,’%1’, TeamFilter2);
IF FORM.RUNMODAL(5107,setteam) = ACTION::LookupOK THEN;
END
And the result just only have appear TeamCode of UserID , not show TeamCode2 …