Error: Idatarow.getprimarykeyvalue has been removed

Hi All, We were using IDataRow row.getprimarykeyvalue to get GUID and retrieve by core.retrieveId to fetch records in version 6. When we moved to 7 version it got removed and we got an error. Could somebody let me know if there is any other method I can use instead. Thanks Abhinay 
2 answers

Hi Abhinay,

Below is a sample code snippet which can used to achieve the similar functionality (as was with getPrimaryKeyValue()) in Mendix 7.x.

List<? extends IDataRow> dataRows = retrieveOQLDataTable.getRows();
IDataRow dataRow = dataRows.get(0); // For example, let us retrieve the first data row
IMendixIdentifier mendixIdentifier = dataRow.getValue(context, 0);
IMendixObject mendixObj = Core.retrieveId(context, mendixIdentifier);

Let me know if this helps you.


Add the Id as a column (0) and get that column, as an extra can check the type (IMendixIdentifier)


Edit 1:

From Module.Table  AS TB

Select TB/ID, *

Yes this not as generic as your solution. Mendix also removed columnSchema.getMetaPrimitive() which I really need.