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.

Creating multiple records

Featured Replies

HI,

I have 2 tables,

Work order table

Designs Table

I have a portal showing my records from my designs table.

I have a field (in my work order), that will be used for users to put a number. Lets say that users put in a 5 in the field. I want my script to create 5 records in my portal (left side of the jpeg). what can i use in my script that can create 5 new records?

Thanks

1.jpg

I would write a script that took a number as a parameter. The script would then go to a layout whose table occurrence is your design table and loop to create the records. Heres some psuedo code:

Go To Layout[Design]

set variable[$counter; 1]

loop

exit loop[$counter > get(scriptparameter)]

new record

set variable[$counter;$counter + 1]

end loop

You could then put a button on the layout to execute the script and have the field that the user is editing data be the parameter.

You could do this with script triggers as well but I don't know if you want to do that

  • Author

Hi Jesse,

I tried creating the script, but its not working for me. can you look at my db and check the script, maybe you can point me in the right direction.

Thanks.

You were right on target with the idea. (want to call up a number and have my script create that amount of new records)

I would write a script that took a number as a parameter. The script would then go to a layout whose table occurrence is your design table and loop to create the records. Heres some psuedo code:

Go To Layout[Design]

set variable[$counter; 1]

loop

exit loop[$counter > get(scriptparameter)]

new record

set variable[$counter;$counter + 1]

end loop

You could then put a button on the layout to execute the script and have the field that the user is editing data be the parameter.

You could do this with script triggers as well but I don't know if you want to do that

WO.zip

Alrighty, I have made some changes. I took out the script parameter and added two variables. One to keep the id of the work order and one to keep the total number of records to create. Here's the file.

WO.fp7.zip

  • Author

Thanks Jesse. Now we're talking...

I have a field (in my work order), that will be used for users to put a number. Lets say that users put in a 5 in the field. I want my script to create 5 records in my portal (left side of the jpeg). what can i use in my script that can create 5 new records?

You're hopefully aware this way of asking in abstractions, might give a solution fitting the abstraction only - there must be a context and purpose as well to question the way you arrived to the abstraction, what if the abstraction you arrived to is based completely on inadequate premises.

Imagine putting a door back on hinges, here isn't the more the merrier that works. If two persons attempt to co-operate the hinge business, will both make the adjustments to any imbalances occurring ...and if both are with their instincts/senses, is the compensation twice of whats actually required, because both makes the adjustments.

...or Goodharts Law:

that any observed statistical regularity

will tend to collapse once pressure is placed upon it for control purposes

However when things are so loosely defined could the same thing be achieved this way:

--sd

WO_sd.zip

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.