herring

How to programmatically change an archived value's time stamp?

Discussion created by herring on Mar 23, 2020
Latest reply on Mar 24, 2020 by Dan Fishman
How can I programmatically change the time stamp of an archived value? I'm going through AFSDK help file and only seeing methods for adding new values or updating values (remove archived value, then insert new value), but not finding how to change just the value's time stamp.
 
If I get the archived value as an AFValue, there is a Timestamp property that has get and set methods, but setting the AFValue's Timestamp property to a new time doesn't seem to work.
  
The reason I want to do this is because I have PIML users that inserted a bunch of data, but due to incorrect PIML configs, wrong times were recorded with the inserted values. I need to update many archived values to their correct times. I want to retain PIML metadata (e.g., user and time of entered data), which is why I don't want to remove values and then insert the values with the correct times since I assume I will lose that if I use the AFListData.UpdateValues() method (remove then insert new value).
 
If I can change the timestamp of a value in SMT > Archive Editor, shouldn't there be a way to do this programmatically?
 
Thanks

Outcomes