I ran into this issue where some of the table columns in a protocol were not being set. After checking the logs, I realized a "HandleNTPutParameterIndex" was being logged indicating that the key for that row that I wanted to set, does not exist. However, I was able to verify that the key does exist at the time of the set because other columns were actually able to be set, which leads me to believe this event is somewhat random. Any insight on what can cause this type of error and a possible fix would be greatly appreciated. I have added the error log below for reference.
2020/12/09 18:23:51.010|SLProtocol - 21672 - WM_TICKETING_02|16864|CProtocol::HandleNTPutParameterIndex|ERR|-1|[Cell update] Table [diagnostics [3200]]: Key (1927) not found DEBUG: varData = VT_ARRAY|VT_VARIANT (3) ~ 0 VT_I4 : 3200 ~ 1 VT_BSTR : 1927 ~ 2 VT_I4 : 17 varData2 = VT_BSTR : Completed
Hello Thijs, the issue indeed is not setting an entire column, but setting a specific cell in a row. A notify method is not used, however, the table property is indexed using the key (as a string) and the column PID to set the specific cell. Is the notify method preferred over this? I have added the snippet below for reference.
protocol.diagnostics[receivedRow.Key, Parameter.Diagnostics.Idx.diagnosticsoverallstatus_3223] = Enum.GetName(typeof(OverallStatus), OverallStatus.Processing);
Hi Julian,
Your approach should be OK. Two things you can verify are:
1) The object that you are passing for indexing “receivedRow.Key”: the accepted type for indexing is either a String or an Integer. As you are refering that your key is the value itself as a string, we should make sure it’s passed along as a string.
In case you would be indexing on that number as integer, then it would look for row x in the table and not necessarily matching the string key value.
2) Second item to verify is if we are sure that KEY actually exists. If you are trying to modify a cell for an unexisting key, then that could explain the issue as well. In that case you probably want to add the full row where we also initialize the other side columns.
I Hope this helps you to get the job done! If not… please let us know 😉
I would like to refer to the comment from Thijs as an answer to this question
Hi Julian, can you share which protocol notify you are using?
You mention about “a row you want to set”. Is this via protocol.SetRow(…)?
My first impression would be that you still have code using the protocol.SetParameterIndex(….), While instead we always advice to use protocol.SetParameterIndexByKey(…). Could it be that your key “1927” is present as a string Primary Key? That could explain why using the SetParmeterIndex with that number will most probably not point to that same rowKey.
Could be something completely else as well, but a snippet of your code used would be helpful to assist you.