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

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

Recommended Posts

Posted

Can someone point me in the right direction for this.

I have a database with 562 records in it and I want to enable the web companion so that people can log in from a web browser and see only about 23 of those records in form view. The 23 records that I want them to be able to see are for a winter tour coming up. I only want them to be able to see them as a report and not be able to search or enter any data (I can figure that part out). I can create a flag field for marking the records that I want displayed but I am not sure where to go from there. I also want the number of records shown to be dynamic based on whether or not I flag them. It seems to me that the best way to do this is to create a related database that has just the fields that I want them to see and have a script so that when I flag a record in the original database it automatically creates a new related record with the correct data in the correct fields in the related database that can then be served up over the web companion but I am not sure how to go about this. I mean, I know how to create a relationship but I am not sure about how to make a script that would create a new record in the related(web) database whenever I flag a record in the original database.

Please help.

Ronzues

Posted

I am not sure that I can do that or if I can I am not sure how. I have never seen that option. I did however try to create a script and a layout with a button on it that would find the flagged records but the button did not work in a web browser for some reason and I tried it on several platforms and several different web browsers.

Suggestions?

Posted

OK. First make sure that you have some sort of unique ID for each record in your main database (an auto-enter serial number will work fine).

In your relalted database (Web.fp5) create a field called MainID (make sure it's the same type as the ID field in your main database).

Create a relationship in Web.fp5 back to Main.fp5. You'll use the MainID field in Web.fp5 to relate to the ID field in Main.fp5.

For whatever fields in Main.fp5 you're wanting to mirror in Web.fp5, create a corresponding field in Web.fp5 (you've probably already done this). Create each field to auto enter it's "parent's" field value (the corresponding field value in Main.fp5) based on a lookup that uses the relationship you defined above.

In the main database, create a global text field, gID.

Create a button in Main.fp5 that calls the following script:

Set Field [gID, ID]

Perform Script [external]

Exit Record/Request

Halt

The eternal script that is called lives in Web.fp5 and looks like this:

New Record/Request

Set Field [MainID, Relationship::gID]

Exit Record/Request

One thing to consider - because this solution uses lookups, any changes to the data in Main.fp5 will not be reflected in Web.fp5 without performing a relookup.

Posted

Okay. I've never done web sharing with FM on either platform so I can't specifically address that. However, I do know that you can create a script that will perform a find and have it run that script at startup of the db. Wouldn't there be a similar function (i.e. to have a script run automatically) when the db is opened via the web? If so, then you can manually perform the find, create a script to go to whichever layout you need to display via the browser, perform the find without a dialogue box and viola.

I'm sure the related file would work but I think it's just a lot of work to go through to get it done and, as John pointed out, the maintenance of that related file (since it is actually a lookup not a true related file) would be tedious.

Posted

Hi Angelo,

The db isn't opened by the browser. The db is assumed to be open before the browser interacts with it. You can run scripts via the browser, but I'm not sure you can do that with Instant Web Publishing.

I think the easiest (though certainly not the most user-friendly) way would be to have the web user search the db for the records that have been flagged.

Posted

John,

I'd have to agree. Maybe the "published" page is just an intro type page and the button (or whatever) that the user clicks on to "enter" the site would perform the find.

Is that what you were thinking too?

Posted

Thanks to all,

John, your info is what I think I needed. I had already created a related file and had already assigned ID's to auto-enter in the main file, then I created a relationship between the main file and the web file based on the ID but instead of using lookups I just used the related fields. That way I could create a new record in the main database and then go to the web database and input the same ID number manually and all of the fields would be filled in for me. That would have worked but I wanted the web file to be updated automatically or by the push of a button instead on me having to go to the file and enter the correct ID number to create a new record. I think what you gave me above will solve that.

The reason that I want a seperate file altogether is because I only want people from the web to see certain records(the ones that are marked for the winter tour)and only certain fields. A related database accomplishes that.

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