Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

-script problems

Featured Replies

  • 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

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.

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.

FM was not design for that purpose.

  • 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.

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].

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

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.