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.

Script to set fields

Featured Replies

Hey guys! I am reallllllly stuck and have been attempting this for hours.

Basically what I've done works fine, I just can't get one step to work, which has ruined the entire thing. I have a set of records that has the "Staff ID" entered into them, I want to extract these IDs into another set of records.

Here's the script as it currently stands:

1. Show All Records

2. Go to Layout ["Staff List"]

3. Go to Records/Request/Page [First]

4. Loop

5. Go to Layout ["Add to Record"]

6. New Record/Request

7. Set Field [TrainingRecord::Staff ID;Staff::STaff ID]

8. Set Field [TrainingRecord::Course ID; TrainingRecord::INSET Course ID]

9. Set Field [TrainingRecord::Date qualification gained; TrainingRecord::INSET Date Gained]

10. Go to Layout ["Staff List"]

11. Go to Records/Request/Page [Next; Exit after last]

12. End Loop

The problem I'm having is with step 7. It won't insert the Staff IDs into the fields, step 8 and 9 take their data from global fields. But the Staff ID field holds multiple different records.

Does anyone have any ideas? I was thinking a find step or something similar, but I have no idea where to start.

Any help would be fantastic! Thanks in advance :)

Here's what I would do, though others may have ideas that are cleaner:

1. Show All Records

2. Go to Layout ["Staff List"]

3. Go to Records/Request/Page [First]

4. Loop

>>>>Copy [select; Staff::Staff ID]

5. Go to Layout ["Add to Record"]

6. New Record/Request

>>>>Paste [select; TrainingRecord::Staff ID]

8. Set Field [TrainingRecord::Course ID; TrainingRecord::INSET Course ID]

9. Set Field [TrainingRecord::Date qualification gained; TrainingRecord::INSET Date Gained]

10. Go to Layout ["Staff List"]

11. Go to Records/Request/Page [Next; Exit after last]

12. End Loop

~Courtney

May be a better way but - definitely stay away from Copy/Paste (very dirty; especially if you have end users). Set some variables instead (example below). Also - use freeze/refresh window to speed it up.

0. Freeze Window

1. Show All Records

2. Go to Layout ["Staff List"]

3. Go to Records/Request/Page [First]

4. Loop

5. Set Variable $$StaffID

6. Set Variable $$CourseID

7. Set Variable $$DateGain

8. Go to Layout ["Add to Record"]

9. New Record/Request

10. Set Field [TrainingRecord::Staff ID; $$StaffID]

11. Set Field [TrainingRecord::Course ID; $$CourseID]

12. Set Field [TrainingRecord::Date qualification gained; $$DateGain]

13. Go to Layout ["Staff List"]

14. Go to Records/Request/Page [Next; Exit after last]

15. End Loop

16. Refresh Window

  • Author

Hey your right I do have a real user, and would like the system to be cyclic.

I tried what you said but it seemed to work worse than before. It just created some blank records. I'm not sure if I used it correctly.

What I need the script to do is to take the Staff ID from each different record, and insert it into another table, with the course ID so it is added to their "Training record". The course id and date gained steps work great but the created records aren't inserting the staff id into the fields, it i s however creating enough blank records to match how many staff Ids there are.

I hope this makes a little more sense. Thanks again! :)

What I need the script to do is to take the Staff ID from each different record

Exactly, and that's what the Set Variable[] step should do.

Go to Layout ["Staff List"]

Show All Records

Go to Records/Request/Page [First]

Loop

Set Variable [$staffID ; Staff::STaff ID]

Go to Layout ["Add to Record"]

New Record/Request

Set Field [TrainingRecord::Staff ID ; $staffID]

Set Field [TrainingRecord::Course ID ; TrainingRecord::INSET Course ID]

Set Field [TrainingRecord::Date qualification gained ; TrainingRecord::INSET Date Gained]

Go to Layout ["Staff List"]

Go to Records/Request/Page [Next; Exit after last]

End Loop

The point here is that until the TrainingRecord::Staff ID field is set, there is no related record in the staff table.

  • Author

Ohh I had missed the Staff ID in the calculation part.

It works! Thank you soooo much! :)

I'll add a dialogue box now so my real user knows its actually done something

Edited by Guest

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.