View SELECTION formula

Can anyone tell me what I’m doing wrong here?

I’m trying to create a VIEW selection formula, but it doesn’t ever work. I’ve debugged the formula using @prompt, so I know that the code is good.

What I’m trying to do is only show documents that have a specific value assigned to a field called “Team”. The formula below is the criteria for which “Team” value to display.


uName := @Name([CN];@UserName);

Super1:=@DbLookup(“Notes”:“NoCache”;@Subset(@DbName;1):@Subset(@DbName;-1);“UserRoles”;“Supervisor1”;2);

Super2:=@DbLookup(“Notes”:“NoCache”;@Subset(@DbName;1):@Subset(@DbName;-1);“UserRoles”;“Supervisor2”;2);

Super3:=@DbLookup(“Notes”:“NoCache”;@Subset(@DbName;1):@Subset(@DbName;-1);“UserRoles”;“Supervisor3”;2);

Super4:=@DbLookup(“Notes”:“NoCache”;@Subset(@DbName;1):@Subset(@DbName;-1);“UserRoles”;“Supervisor4”;2);

SELECT @If(@Contains(Super1;uName) ; Team=“1” ;

@If(@Contains(Super2 ; uName) ; Team=“2” ; @If(@Contains(Super3 ; uName) ; Team=“3” ; @If(@Contains(Super4 ; uName) ; Team=“4” ; “”))))


Subject: View SELECTION formula

DOH!!!

NEVERMIND!!!

Subject: View SELECTION formula

Just for the sake of anyone who searches and finds this thread: you can’t use @DbLookup in a view column or selection formula at all, and you can’t use @UserName in a selection formula in a shared view.