AnsweredAssumed Answered

Creating new record using existing record as template works in FMP but not IWP

Question asked by AlanSawyer on Nov 26, 2010
Latest reply on Nov 27, 2010 by AlanSawyer


Creating new record using existing record as template works in FMP but not IWP



My table User is related to a table Sample through User_ID (unique for each User)

Another instance of the table Sample (called Sample2) is related to User using User_ID so that I can see all of the samples that the user has in a self-join portal.

I use a script to create a new record in Sample2 from the table User

The script I have written first sets a variable $UserID to the User_ID in the table User then switches layout to the Layout showing records from Sample2, creates a new record, sets the field User_ID in Sample2 to the value of variable $UserID.

This step works really nicely and I can see the name of the person appear in the new record so the relationship is built properly.

I then use another script from a button in the portal (self-join and displaying the records from Sample) to set all the values in the current (new) record in Sample2 to those contained in the appropriate record from the table Sample so that my user can use the data they have already entered (from pre-existing samples in their sample library) as a template which they can then edit and submit (another button that commits the data and returns them to the User layout).

This all works really nicely in Filemaker, but as soon as run these scripts through IWP all the steps work right up to the final one.

If I have manually entered everything the record comes back blank

If I have used a template by copying across and then editing the template to something new and clicking the submit button (which commits all the data and then returns to the User layout) when I examine the details of that sample it turns out that the edits I made were not saved and the fields are populated with the data from Sample before I edited them.

As I said, this script works perfectly if doing it within Filemaker, but does NOT work through a browser.

There are no web-publishing incompatible script steps (I chaecked this very thoroughly)

It is not a permissions problem as I tried this through an all-access account with the same result.

I've been trying to work out what is going wrong now for 5 days and it's driving me nuts. I am a very experienced FMP user (been doing these databases since FMP2) and can only conclude that this is something to do with the way that committing data is done in IWP and may well be a limitation of IWP.

Can anyone help?



FMP11 Advanced. Filemaker Server10 Advanced. Mac OS X 10.6.4