I have stepped through and debugged my code and the id that is being passed to the GetItem()
method is the ID of the training plan I am looking to get and the custom table class name is correct (It is getting the correct custom table.
However the returned item is the first item in the custom table (I've looked in the database) not the item with the ID that was entered.
int id = parameter.ID;
CustomTableItemProvider provider = new CustomTableItemProvider(CMSContext.CurrentUser);
entity = provider.GetItem(id, TrainingPlanConstants.TrainingPlanTableName);
This unrelated custom table item is returned no matter what integer value is input. I have done a work around by using the GetItems() method - but this is not ideal as I know which CustomTableItem I want and this workaround is an unnecessary loop.
(Version 7)
GetItem()
? devnet.kentico.com/docs/7_0/devguide/… What happens when you call the overload with Guid?