Help

FRN funkiness - Customizers?

tvreeland
Journeyman

FRN funkiness - Customizers?

I put this out on the PSUG email group, but figured I'd post here as well - perhaps different people will see it.

 

I've come across some odd behavior when submitting data through forms within the PowerSchool admin portal. I stumbled on it while working on updates to my attendance kiosk.  I'm finding that a new Attendance_Time record is created when I try to update an Attendance record, and I can't understand why exactly.

 

I've got an Intel NUC with a barcode scanner in the lobby.  Students scan their ID and the page submits the ID value to a page that verifies and validates all the attendance info related to that ID.  That page has a hidden form.  The page's script validates and then places the needed data into the hidden fields.

 

One of the fields on this validation page is the FRN.  This will either be 157-99, if there is currently no attendance record or 157xxxxxxx  if the record already exists.  After the script finishes filling in the form, it submits itself.

 

Now, the data is received on the next page with the FRN as a POST value.  This page has 5 hidden fields that are mapped to the Attendance record: [Attendance]Attendance_CodeID is one example.  When I inspect the field on the rendered page, I see that the name has properly converted into the UF-157xxxyyyyyyy format (xxx = field ID and yyyyyy = DCID), so I know this is working properly.

 

This page will do some more work - mainly around calculating # of minutes attended and # minutes in the day, to determine absence status if a half-day of school is missed.  

 

NOW - this is where things get weird.  When the Attendance data submits, the next page is going to handle the Attendance_Time record. This has to be a separate step because the attendance record MUST exist before creating the time record. (I guess one could create the time record, create the attendance record, look up the ID of the attendance, and then update the time record again...but that's silly.)

 

However, in order to update the Attendance_Time data on the next page, I need to pass the proper FRN (158-99 or 158xxxxxxx) when the Attendance is submitted.  So, the Attendance page has a field like this that is filled in with the appropriate value when the Attendance page loaded:

 

<input type="hidden" name="frn" value="~[gpv:timeFrn]" />

 

My thinking is that this FRN value will get passed to the next page, causing the appropriate fields to be linked back to the data, like <input type="hidden" name="[158]Time_In" value="" id="timein" />. And, it does - when the time page renders, I see the fields with the UF-157xxxyyyyy format.

 

However, it seems like submitting the Attendance page when the "frn" field has a valid time FRN (158xxxxxx) is causing the Attendance data to update AND causing a blank Attendance_Time record to be created (Time_In, Time_Out and Total_Minutes all are 0).

 

Strangely, if no time record exists, having "frn" = "158-99" does NOT create a new record on submitting the Attendance data.  So, if a student is marked absent (no time record) and comes in late, the new time record is created properly and no "blank" record was created.  Here's an example where I signed in at 2:47PM, so the code is Tardy-Absent.  Note that there is one time record at the bottom, as is expected:

ResultForAbsentComingIn.png

 

However, if a tardy student with a time stamp tries to sign out, a blank time record is created (red box below) AND the proper time record has the Time_Out updated, as expected:

ResultForTardySigningOut.png

 

Anybody have a clue why the Attendance_Time record would be created WHILE doing an update of the  Attendance data?  It's making my head hurt.

 

I'm happy to share code, if anybody wants to look at my ugly style 🙂


Great Doubt is the Beginning of Great Enlightenment.
0 Replies