In a QAction I need to get a row of a table by it's DisplayIndex or to be precise by whatever is defined as "/naming" in the table definition?
Table definition:
<Param id="1000" trending="false" save="true" export="200">
<Name>Great Table</Name>
<Description>Great Table</Description>
<Type>array</Type>
<ArrayOptions index="0" options=";naming=/1002">
<ColumnOption idx="0" pid="1001" type="retrieved" options=";save"/>
<ColumnOption idx="1" pid="1002" type="retrieved" options=";save"/>
<ColumnOption idx="2" pid="1003" type="retrieved" options=";save"/>
....
....
If I pass the DisplayIndex to NT_GET_PK_FOR_DISPLAY (162) I get the same value that I passed to it:
int displayColumnID = 1002;
string displayKey = "Device A";
string primaryKey = (string)protocol.NotifyProtocol(162/*NT_GET_PK_FOR_DISPLAY*/ , displayColumnID, displayKey);
The returned value is "Device A", the value of the column 1002 while the expected value is the value of the column 1001 and it is not "Device A".
Hi Igor,
This method only works with attribute DisplayColumn instead of the naming option. Do note that we don't recommend anymore to use the DisplayColumn attribute.
For your situation I would suggest to retrieve the Primary Key column and the column containing the Display Key by using NT_GET_TABLE_COLUMNS (321)
Then in a for-loop you can map the Primary Key with the Display Key in a dictionary.
Hi Igor,
We will start an investigation to find out if this was working for the naming option in the past or not. For sure we will update the documentation accordingly.
Thanks Jens for the answer,
Can you please trigger the documentation team so as to include the remark about the DisplayColumn attribute in the DataMiner Development Library.
The example there does name the certain variable as displayColumnID, but the description of that variable is a bit confusing, it says “…column…that contains the display keys”.
In the same document the description of the “naming” option states that it is about display keys.