Can't get a hide when to hide properly using IsMember?

Hey,

I have the code below. It should in theory not need the loop from what I think I understand. (Which is not much).

The IsMember should return a boolean which is what the hide when should use to display the button or not.

When the code executes the IsMember never returns a value.

I tried using a for loop to compare my name to the names in the list and set the boolean, however that did not work either.

Anyone have a suggestion on hiding the button using a group lookup?

Thanks,

Shawn

REM {Shawn Taylor - October 30, 2007};

REM {Determine if the user is in the admin group. If they are, show the configuration button};

REM {Determine if the user is a member of the group - Lotus Admin};

itUsers := @DbLookup(“Notes”:“NoCache”; “RALDOM”:“Names.nsf”; “(GroupDataLookup)”; “IT”; 2);

myPrompt := @IsMember(@Name([CN];@UserName); itUsers);

@For(n := 1;

n <= @Elements(itUsers);

n := n + 1;

@If(

itUsers[n] = @Name([CN];@UserName);

myPrompt = 1;

myPrompt = 0)

);

REM {Display those results};

@Prompt([Ok]; “Boolean Value from atContains”; myPrompt);

@Prompt([Ok]; “My User”; @Name([CN];@UserName))

Subject: Can’t get a hide when to hide properly using IsMember?

@Prompt can’t display a boolean value. Try this:

@Prompt([Ok]; “Boolean Value from atContains”; @Text(myPrompt));

You’ll get either a 0 or a 1 as the result.

Subject: Can’t get a hide when to hide properly using IsMember?

Is the view’s 2nd column actually displaying the common name of the users?

Not sure what the @for is needed for, the hide-when could just be the first few lines - obviously not setting the @ismember value to a variable, that just being the result of the formula, either true or false.

For testing, try prompting the first element of the dblookup, make sure you’re actually getting what you think you’re getting back from the view.

Subject: RE: Can’t get a hide when to hide properly using IsMember?

Hey Dan,

Initially I was using the for loop to prompt the returned list.

Yes, I get three common names back from the list lookup.

My problem is, the IsMember does not return a result.

If I use:

itUsers := @DbLookup(“Notes”:“NoCache”; “RALDOM”:“Names.nsf”; “(TorexGroupDataLookup)”; “IT”; 2);

@IsMember(@Name([CN];@UserName); itUsers);

as my hide when formula it hides the button wether I am listed or not.

It’s noteworthy to mention the button is in a POFU view. I am deleting the cached view every time I make a code change.

Thanks,

Shawn

Subject: RE: Can’t get a hide when to hide properly using IsMember?

When you say @ismember is not returning a result, it must be either true or false, so I assume you mean it always returns false.

I’m not sure whether the POFU view will cause a problem to be honest, I never use them.

So you’re 100% certain that one of the members of itUsers is exactly the same as @name([cn];@username)? Prompt both of these and just make sure. If they are, then maybe the POFU view is the problem I guess - can’t see why though.

Subject: RE: Can’t get a hide when to hide properly using IsMember?

Hey Dan,

When I prompt them they appear blank. No True, False, 1 or 0.

however it appears to be working when I use the IsMember without the variable assignment as you suggested (And how I originally I had it).

I think it had to do with the cached POFU view.

Thanks,

Shawn