Brit-Flick Posted February 11, 2008 Posted February 11, 2008 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 :)
Courtney Posted February 11, 2008 Posted February 11, 2008 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
FruitFul Posted February 12, 2008 Posted February 12, 2008 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
Brit-Flick Posted February 12, 2008 Author Posted February 12, 2008 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! :)
comment Posted February 12, 2008 Posted February 12, 2008 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.
Brit-Flick Posted February 12, 2008 Author Posted February 12, 2008 (edited) 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 February 12, 2008 by Guest
Recommended Posts
This topic is 6130 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 accountSign in
Already have an account? Sign in here.
Sign In Now