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

Records creation script problem

Featured Replies

  • Newbies

I am having a bugger of a time with this one script we use for creating new records. I built up some new layouts and imported the button using (copy) and then (paste layout objects). It works on the old page but not on the new. In fact all of the other buttons work on the new page but just not this one.

The button is supposed to create a number of records (that we use to print labels of) based on the number we fill into a field called (total_reels) For example it we type in 7, we should be able to click the button and 7 records will be created.

THE PROBLEM - It begins creating an infinite amount of records and does not stop until I hit escape.

Any suggestions?

Cheers

Dino

Is the layout of the same file or referenced file? What is the script? The loop script is not being able to exit on its condition.

  • Author
  • Newbies

the layout is a different layout of the same file and might have some fields that are not in the original layout.

The action is taking place through a portal connecting one database called "Labeling database" and another called "Inventory for Labeling"

The layouts in question are both in the Inventory for labeling database.

the script is an external one so the complete path is as follows:

Copy[select,"inventory_id"]

If["total_reels<>""and total_reels>0"]

Copy[select,"inventory_id"]

Go to Related Record[show,"Labeling Database"]

Perform Script[sub-scripts,External:"Labeling Database.fp5"]

Else

Show Message["You m,ust specify the total number or reels before you can use this feature."]

End If

the subscript is as follows:

Go to Layout["ALL FIELDS"]

If["Status(CurrentFoundCount)=0"]

Set Field["current_reel_count","0"]

Loop

Perform Script[sub-scripts,"Create One Label Row"]

Set Field["end_reel_range","Inventory for Labeling::total_reels"]

Exit Loop["current_reel_count = end_reel_range"]

End Loop

Else

Show Message["Label records have already been created for this item"]

End If

Go to Layout[original layout]

Toggle Window[Minimize]

the --Create One Label Row script is as follows:

New Records/Request

Paste[select,No style,"inventory_id"]

Set Field["current_reel_count","current_reel_count+1"]

Set Field["end_reel_range","Inventory for Labeling::total_reels"]

Set Field["reel_no","current_reel_count"]

Set Field["notes","Inventory for Labeling::label_type"]

Any help would be greatly appreciated if by nothing else the hair that is left on top my head from being pulled out.

Cheers

Dino

Dino,

If you are saying that it uses the same table (file in FM6) that the original script was running from, then I would take a look at the following fields.

1. Are current_reel_count and end_reel_range global fields?

2. Has Inventory for Labeling::total_reels field been properly set.

3. Does the field inventory_id exist on your new layout???

FWIW, I do not like the way this loop script is written. Using copy and paste is not really wise. Let me know the answer to the questions.

  • Author
  • Newbies

Aha

John yes the inventory id field was NOT on the new layout (it is a behind the scenes non visible field). OK that fixed that issue perfectly thanks.

Cheers

Dino

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.