Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7562 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi

Could someone tell me if this is possible - I have a global field (aelist) in my database with several user names, what I want to do is check the current username against a name in 'aelist' to see if there is a match. The code I though it would be is (doesn't seem to work) - thanks. Also, why can't I post any text after the code below in this forum?

[FMP-if:aelist.cn.{currentusername}]Hit[FMP-Else]Miss[/FMP-if]

Posted

Hi, mindtpi99! Umm... I may be wrong (correct me, folks!) but isn't it [FMP-ClientUserName] for web users? Also, I'm only a semipro-once-in-a-while FileMaker Web developer so I get rusty, but here's my guess at what your tag should be...

[FMP-if: field:aelist .cn. {FMP-ClientUserName}]Hit[FMP-Else]MIss[/FMP-if]

Sorry -- can't help w/the code problem since I don't like to use it, but I don't think others have had trouble. If you are manually typing in the "code" command, maybe you need to close the tag? I almost always use the QUICK REPLY but I just checked the normal reply area and it has a little auto-thing that puts the tags up for you (both opening and closing code tags) and maybe you're closing tag fell off? I dunno.

--ST

Posted

Mindtpi99,

Why are you using a global field that has all the user names in it? Is it a repeating field? Otherwise how would you store diffrent user names when a global is universal throughout the entire database? Also, try not to use globals while web-publishing. It can mess everything up.

Justin Grewe

Posted

Hi,

"try not to use globals while web-publishing" - good point Justin.

People developing FileMaker for client/server environments often use Globals for temporary storage. Bad move on the web as you don't know who else is going to submit at almost exactly the same time.

Store stuff in Tokens or cookies (FMPro cookies work reliably if they are set to expire at the end of the session).

Also the syntax for a field in the right side of an "If" should be:

[FMP-IF:fieldname.cn.Field.fieldname2]

or using a cookie:

[FMP-IF: FMP-COOKIE:userid.eq.Field.username]

FileMaker expects a field on the left side so you don't need to declare "Field", but expects text /number on the right so "Field" is needed. You don't need to bracket it, in fact I think that doesn't work. Like most PMP stuff it doesn't appear to be case sensitive.

regards, jeff

Posted

Garry,

How would mindtpi99 keep multiple instances of users in one global? A global is not allowed to be a repeating field, right? And the global is universal with only one value at a time throughout the entire database, right? How else is this possible then Garry? If there is a way, I would really like to know.

Justin Grewe

Posted

My assumption is that it is a list of users allowed certain access.

By using "contains" as the search criteria, a string of many words can be used.

For example:

"Allowed Users" Global Text { smith, jones, boots, green, bloggs }

The Form would have:

<input type="hidden" name="-op" value="cn">

Enter User Name: <input type="text" name="Allowed Users" value="">

All the best.

Garry

Posted

Thanks for everyone's comments - Garry is quite correct in what I want to do.... The format for the conditional for what I wanted to do that seems to work is;

[FMP-IF:globalfieldname.cn.{clientusername}]Show this HTML Code[FMP-Else]Don't show it[/FMP-if]

cheers

howard

This topic is 7562 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.