Help Script Multiple Fields Mandatory Value For Find
I am using a simple login script where the USER NAME field and the
PASSWORD field in a search must be the same for the user to get into
the records.
It is simply a find, where the user and password must both be the
same. The problem I am having is that Filemaker is finding the record
when the username is correct and the password is blank and the same
happens when the password is correct but the user is blank.
Any ideas ?
-S
Re: Help Script Multiple Fields Mandatory Value For Find
In article <1187233245.729232.202310 [at] r29g2000hsg.googlegroups.com>,
squeed2000 [at] yahoo.com wrote:
> I am using a simple login script where the USER NAME field and the
> PASSWORD field in a search must be the same for the user to get into
> the records.
>
> It is simply a find, where the user and password must both be the
> same. The problem I am having is that Filemaker is finding the record
> when the username is correct and the password is blank and the same
> happens when the password is correct but the user is blank.
>
> Any ideas ?
If you want both fields, then you have to do and "AND" find. The
process is the same whether you do it manually or via a script:
Enter Find Mode
Set Field [Name, gTexttoFind]
Set Field [Password, gTexttoFind]
Perform Find
Both fields must be set on the same Find Request.
Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
Re: Help Script Multiple Fields Mandatory Value For Find
The problem that I am having is this. I have a single table in this
solution. There are many fields in the table and 2 of them are user
and password. When the application opens, a script brings the user to
a form that is in find mode that has user and password on it.
They are not global fields. What is happening now is that a user can
enter partial information and Filemaker finds it.
So for example, if the user name is "User" and the password is
"Password" if the user enters "U" as the user name and "P" as the
password, Filemaker will "log them in", in effect, it is finding every
record in the database and returning it.
I have an error capture step where if no records are found, Filemaker
brings the user to another form and tells them that their login is
incorrect.
The other problem is that it is not in AND search mode, and setting
fields doesn't help because I am in find mode and the Set Field would
have to place the value that the user was entering in the search
fields which in find mode, Filemaker doesn't know what the user has
entered until the find is performed.
-S
Re: Help Script Multiple Fields Mandatory Value For Find
In article <1187307578.799704.54090 [at] g4g2000hsf.googlegroups.com>,
squeed2000 [at] yahoo.com wrote:
> The problem that I am having is this. I have a single table in this
> solution. There are many fields in the table and 2 of them are user
> and password. When the application opens, a script brings the user to
> a form that is in find mode that has user and password on it.
>
> They are not global fields. What is happening now is that a user can
> enter partial information and Filemaker finds it.
>
> So for example, if the user name is "User" and the password is
> "Password" if the user enters "U" as the user name and "P" as the
> password, Filemaker will "log them in", in effect, it is finding every
> record in the database and returning it.
>
> I have an error capture step where if no records are found, Filemaker
> brings the user to another form and tells them that their login is
> incorrect.
>
> The other problem is that it is not in AND search mode, and setting
> fields doesn't help because I am in find mode and the Set Field would
> have to place the value that the user was entering in the search
> fields which in find mode, Filemaker doesn't know what the user has
> entered until the find is performed.
You will have to change your system so that the user enters their User
Name and Password into Global fields, and then script the find after
that using Set Field to transfer the user-entered data.
It's often a good idea to not let users have access to Find mode
itself, but instead script the find through Global fields.
To make sure only an exact match is found, the script can use the Exact
Match symbol (the "=" symbol).
eg.
Go To Layout [UserEntersData]
Pause
Enter Find Mode []
Set Field [UserName, "=" & gUserEnteredUserName]
Set Field [Password, "=" & gUserEnteredPassword]
Perform Find []
where gUserEnteredUserName and gUserEnteredPassword are Global fields.
In newer versions of FileMaker you can probably use Parameters instead
of Global fields and / or utilise a pop-up message with with user
input.
Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)