I am using AF to replace a batch of historical values. Usually they will completely match with the current values but sometimes they won't. So I am deleting the existing values first. This means that when I add the new values, the Substituted flag won't be set, so I need to manually set it. However, I don't seem to be able to do this.
If I do
// add new AF Value into the results table AFValue newVal = new AFValue((AFAttribute)analysisRow.Attribute, calcRes.Value, calcRes.Timestamp); newVal.Substituted = true; results.Add(newVal);
(Stupid editor! Maybe it will be readable to you once I post it) then when I do
errors = AFListData.UpdateValues(results, AFUpdateOption.Replace);
The values go in but are not marked as Substituted
If on the other hand I do
AFValue newVal = new AFValue((AFAttribute)analysisRow.Attribute, calcRes.Value, calcRes.Timestamp, null, AFValueStatus.Substituted); results.Add(newVal);
Then the values all go in as "Set To Bad" digital states rather than the proper values. What is going on and how can I set the Substituted flag?