Upgrades Questions on upgrading to version 7.x.
Version 7.x > Upgrades > CMS.SiteProvider.CustomTableItem inaccessible View modes: 
User avatar
Member
Member
beau.cowan-rrpartners - 2/11/2013 8:23:56 PM
   
CMS.SiteProvider.CustomTableItem inaccessible
In of our custom Webparts, we are using this class for our mailing list. Now that we are upgrading from 6 to 7, I'm finding that the CustomTableItem is inaccessible due to it's protection level.

Is there something else that I need to download for this to work properly, or is there a different function/class that I should be using instead that will give me the same results for this instance?

User avatar
Kentico Support
Kentico Support
kentico_janh - 2/12/2013 3:20:07 AM
   
RE:CMS.SiteProvider.CustomTableItem inaccessible
Hello,

There were API changes between versions 6 and 7 and following article describes them:

API Changes From Kentico CMS 6 to 7

However you should be able to access the CustomTableItems using following API:
CMS.SiteProvider.CustomTableItemProvider.GetItems(...)

Best regards,
Jan Hermann

User avatar
Certified Developer 13
Certified Developer 13
lfrese-imediainc - 3/19/2013 6:39:37 PM
   
RE:CMS.SiteProvider.CustomTableItem inaccessible
What about creating a new CustomTableItem?

I am unable to create a new one using the below code:
CustomTableItem newCustomTableItem = new CustomTableItem(customTableClassName);

taken from the CMS7 dev guide Modules > Custom tables > Custom tables internals and API > API examples:

Error is :
CS0122: 'CMS.SiteProvider.CustomTableItem.CustomTableItem(string)' is inaccessible due to its protection level

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 3/19/2013 7:55:07 PM
   
RE:CMS.SiteProvider.CustomTableItem inaccessible
I believe your syntax is incorrect. Take a look here. Looks like it should be:
CustomTableItem newCustomTableItem = CustomTableItem.New(customTableClassName, customTableProvider);

User avatar
Kentico Support
Kentico Support
kentico_janh - 3/20/2013 3:19:58 AM
   
RE:CMS.SiteProvider.CustomTableItem inaccessible
Hello,

As FroggEye mentioned and even in the Site Manager -> Support ->API Examples section there is following code for an item creation:
// Create new custom table item 
CustomTableItem newCustomTableItem = CustomTableItem.New(customTableClassName, customTableProvider);

Best regards,
Jan Hermann

User avatar
Certified Developer 13
Certified Developer 13
lfrese-imediainc - 3/21/2013 9:53:47 AM
   
RE:CMS.SiteProvider.CustomTableItem inaccessible
Thanks Froggie and Jan. That worked!