AnsweredAssumed Answered

error.key.PIPoint.ID returning null instead of Id

Question asked by Shubhangi on Jul 6, 2020
Latest reply on Jul 7, 2020 by Shubhangi

I am updating pi points using UpdateValues() method and storing the errors(if occurred) in a variable of AFErrors<AFValue> type. In order to test this functionality, i deleted the pi point from Pi System Management tools and then tried to update the same pi point .

 

I am getting error value in my variable but when i am trying to access PiPoint Id from the error variable, it's returning null. Why?

 

Please find the below code for reference:

 

 var errorMessageDetails = new Dictionary<int, string>();

AFErrors<AFValue> piServerErrors = piServer.UpdateValues(afValues, OSIsoft.AF.Data.AFUpdateOption.Replace);

foreach (var error in piServerErrors.Errors)
{

 errorMessageDetails.Add(error.Key.PIPoint.ID, error.Value.Message);

}

 

Question: Why error.Key.PIPoint.ID is returning null. Is it because i have deleted the pi point from Pi System Management tools?

 

aferrors

Outcomes