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

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

Recommended Posts

  • Newbies
Posted

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

Posted

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.

  • Newbies
Posted

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

Posted

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.

  • Newbies
Posted

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

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