February 11, 200818 yr 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 :)
February 11, 200818 yr 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
February 12, 200818 yr 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
February 12, 200818 yr 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! :)
February 12, 200818 yr 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.
February 12, 200818 yr 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 February 12, 200818 yr by Guest
Create an account or sign in to comment