Setting a variable at initial check in PDM

I am having trouble setting a variable during the initial check in of a file. I believe what I currently have was working in EPDM 2015, but I cannot confirm.

After adding the appropriate hooks, OnCmd checks if command type is "EdmCmd_PreUndoLock" and file's current version is "1"; if true, get/set variables. Stepping through the code, everything executes as expected. However, after the check in operation is complete, the variable is not the updated value.

Why do I check for "EdmCmd_PreUndoLock"? I found from exploring that this is the only command that triggers when checking in the file for the first time. It does not really make sense (documentation says it "One or more files are about to get their locks removed without any changes sent to the file vault") why this triggers at the initial check in, but it is behaving as I would expect but not as I would like (the variable I set is not saved).

When I check for "EdmCmd_PreUnlock" the variable is set at expected, so I do not believe it is an issue with the code that sets the variable value.

What I want to achieve is an add in that reads a variable value (DESIGNER) then sets another variable value (SUPERVISOR) based on the first. Currently, I am running SOLIDWORKS PDM Professional 2016.

Does anyone have a suggestion? Or an alternative?

SolidworksApi macros