Jump to content

Set up logic and scripting


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

Recommended Posts

I sure hope you guys are willing to read through all this and help with a solution.

We have two types of Users. "Patrons" and "Customer".

Both of them come to the same layout when the solution opens and will brows the same layouts. Patrons will look at products and vote on them, Customers buy products, based on the voting of the Patrons. For the sake of this discussion, Patrons are NEVER Customers and Customers are NEVER Patrons.

OK, so a person comes to our site and at this point, we don’t know if they are a Patron or a Customer. They will make that determination as they view the site.

I guess my sense of it would be, if the person viewing the site is a Patron they would click a button and go to the Patron layout and fill out the standard Name and Address, email address, User name, password etc.

If the person is a customer they would click a button, go to a different layout and fill out the standard Name and Address, email address, User name, password. Plus credit card and shipping information.

I think we would want anyone coming to our site to always see the same opening Home page. Here I’m a little more confused on how to handle this. Because we have people coming to the site for the first time or a follow-up visit, as well as someone who has already signed up as a Patron or a Customer. What do you think, a “Patron” button and a “Customer” button on the Home page that would take them to their respective sign in layout where they sign in. Or have them fill in their User name and Password on the Home page and then click either the Patron or Customer buttons? Or some other way? I hope you guys have had some experience with this kind of thing, because I'm not at all sure how to handle it.

What do you guys think? I not only have to figure out the best way to do it, but also how to script it. A monumental task for a Wyoming cowboy! :)

Milo

Edited by Guest
Link to comment
Share on other sites

They could start on the same page and you could redirect them based on their login info.

And/or you could store a cookie in their browser so it remembers them for next time.

Link to comment
Share on other sites

You can have Filemaker run a script on open. That script would need to include a way of determining if an account belongs to a Patron or a Customer. Depends on how your Privileges are already set up.

If all Customers have the same Privilege Set and all Patrons have the same Privilege Set, it's easy. You use Get(PrivilegeSetName). If not, you can store Account Names (but not passwords!) in a Contact file along with the Patron or Customer designation. When a user logs on, the script goes to the Contact layout, looks up the Account Name and grabs their status.

The script would contain steps along these lines...

If [Get(PrivilegeSetName) = "Patron"

Go To Layout [Patron]

Else If Get(PrivilegeSetName) = "Customer"

Go To Layout [Customer]

Else If [1]

Go To Layout [Other]

End If

Link to comment
Share on other sites

Hi David,

If I read the script correctly. If you are not defined as a Patron or a Customer, you go to the standard Home page. If you've already been defined as a Patron or Customer you go to the respective opening layout right?

That seems like a very straight forward way of handling the situation if I'm reading you correctly.

Milo

Link to comment
Share on other sites

Thanks David,

One more question.

OK, so a person comes to our site and at this point, we don’t know if they are a Patron or a Customer. They will make that determination as they view the site.

I guess my sense of it would be, if the person viewing the site is a Patron they would click a button and go to the Patron layout and fill out the standard Name and Address, email address, User name, password etc.

If the person is a customer they would click a Customer button, go to a different layout and fill out the standard Name and Address, email address, User name, password. Plus credit card and shipping information.

Do you agree this is the best way to handle the above?

Milo

Edited by Guest
Link to comment
Share on other sites

Hi again David,

Even though it's the first time i've ever set up the Accounts & Privileges I think I set "Patron" and "Customer" up correctly and per your instructions I added a "UserType" field to show which is a Customer and which is a Patron on the sign up layouts.

What I'm not at all sure of is how to set up the script from the Home page for them to set up their user name and password. I have UserName and Password fields on the "Patron" and "Customer" layouts. Do I need these fields or do I use whats built into Accounts & Privileges?

Looking at Accounts in the script manager I think I have six questions.

1. How do I set up the script that will set up their initial UserName and Password?

2. How do I set up Delete Account?

3. How do I set up Reset Account Password?

4. How do I set up Change Password?

5. How do I set up Enable Account?

6. How do I set up Re-Login?

This is an area that I know I can't afford to make a mistake. So if you can help me with the script or tell me where to go to find it that would be great!

Thanks David,

Milo

Link to comment
Share on other sites

This topic is 6097 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.