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

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

Recommended Posts

Posted

Hello,  I manage a bunch of files for Fire Departments.  After the winter we have had I need to come up with an automated way to create attendance records after a weather event like a blizzard.  Normally each firefighter either scans a barcode or selects their name from a dropdown to create an ATTENDANCE record for them which is related to the EVENT (Attendance Table for attendance and Events table for Events).  Typically to create the attendance record I grab the key field "ID" from the event and the Personnel Record "ID" from a value list dropdown on the incident report and then create an attendance record in a portal on the Event Layout.   

One of the departments responded to 120 calls just yesterday and none of the members had time to sign in for each event.   I'm having trouble thinking of a good way to create a list of the members that were present for the calls (it's the same for each call) and then create a loop script to create a new attendance record for each event for each firefighter.   I can easily get a found set of ID's for the events that need attendance records created but i'm not sure if I should do this attendance process by creating another layout or table to store the personnel record "ID's" and store the event ID as a variable and then make script to loop to create the attendance records in the attendance table.  

I hope I explained that well enough for everyone to understand.   

Thank you in advance for your time.  

Chris Koansh

 

Posted

I don't think you need to create additional tables or layouts. Using a script, if you can store the Event IDs in a variable and the Personnel IDs in another variable, you can than go to the Attendance layout and do something like:

Set Variable[ $i ; 0  // this is our event counter ]
Set Variable[ $eventCount ; ValueCount( $EventIDs ) ]
Set Variable[ $personCount ; ValueCount( $PersonIDs ) ]

Loop
  Set Variable[ $i ; $i+1 ]
  Exit Loop If[ $i > $eventCount ]
  Set Variable[ $event ; GetValue( $EventIDs ; $i )]
  Set Variable[ $p ; 0  // this is our person counter, reset to 0 after each event ]
    Loop
      Set Variable[ $p ; $p+1 ]
      Exit Loop If[ $p > $personCount ]
      New Record
      Set Field[ eventID ; $event ]
      Set Field[ personID ; GetValue( $PersonIDs ; $p )]
    End Loop
End Loop

 

Posted

Wow.  That is amazing that you were able to whip that up for me.   I think I can follow about 80% of what you are doing.   

I think I can make those items you send above into a script, however forgive me for asking, but where would i get the values of the members ID's that were present for the calls (it's not every member).  

Would I need to pull them from maybe the first event report / attendance portal, I could create the first attendance report manually and then fill the rest of the found set with the members from the first related event report.   

Thanks

Chris Konash

 

Posted

Sure, if you have a portal with the members you want, you could use List( related::memberID ) to snag them. Or you could even just hard code them -- List( 123 ; 589 ; 321 ; etc. )

It's also nice to have a summary field in your main tables using the "List of" option on your ID field. That enables you to get a list of IDs for the current found set. Very useful for this type of scenario.

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