September 3, 200124 yr Newbies I am trying to run a script accros the web. I know this is not good practice but this is a import script only for one administrator to do every now and again so there is no risk of others running scripts at the same time. My script works localy but not not in the browser. If I set the first goto browse mode to pause and then click continue it works. My script Goto layout Show all records enter browse mode import records show all records enter browse mode My link <a href="FMPro?-DB=database.fp5&-Lay=www&-Format=find_res.htm&-Max=25&-Error=error.htm&-Script=update&-FindAll">Update</a> using FM U5 and also FM 5.5 TIA Ric
September 3, 200124 yr As long as the link is not from default.htm it reads like it should work. As to the script, I do not understand why you have enter browse mode twice. I don't even know that it is necessary once since everything done via the web would in all likelihood be done in browse mode.
September 4, 200124 yr Inastant or Custom? I'll bet it's instant, which cannot run scripts any more sophisticated than "go to layout". It can be done with custom, very easily.
September 4, 200124 yr Author Newbies Thanks guys. Anatoli what do you mean 'FM was not design for that purpose.' Pls expand. It is custom publishing and the page is not default.htm. I agree I don't need the enter browse mode but I was experimenting and when I pause the script on the first enter browse mode the restart the script locally it works?: Any more ideas would be great.
September 5, 200124 yr Ric T, Using a couple of old files which I converted and related for the purpose, I replicated what you are attempting with simple html/cdml and tested it. It ran fine. The "secret" is that before you write your script, go to File/Import ... and perform the import activity designating which field or fields to import. Helpful hint. If you first will set up a relationship, you can then just import one unique id field and auto-lookup the rest. If you go this way, be sure to select "Perform auto-enter options while importing...", click OK. Then write your script in database.fp5: Show All Records Import Records [Restore, No dialog, importfrom.fp5] Show All Records If you are going to use the script you have already written, revisit that script. Revisit the line Import Records... When you are selecting the database to import from (importfrom.fp5) if you are asked to Keep or Replace, select Replace. I put a button on the layout and ran the script. The import (using an auto-lookup) worked smoothly. I deleted all records and did it over the browser. Using your basic link approach it worked for me, and I displayed the 12 imported recordsd within an [fmp-record]...[/fmp-record] on the success page. You may or may not want to add a Go To Record [last].
September 5, 200124 yr RE: Anatoli what do you mean 'FM was not design for that purpose.' It much depends on your real live scenario. If you will be single user doing such things to your data, then the idea will work. If that will be on web and you expects visitors, then one day will be more people in the same moment trying to take control over single application and it may just do havoc with your data.
Create an account or sign in to comment