Editing custom data classes

This issue has been solved. See solution.
EMercado's picture

Hi everyone,

 I created a custom data class with several attributes, and I'm finding I don't need one of those attributes any longer, but I still need the other attributes in the data class. I'm not seeing ANY WAY of modifying/editing the data class except to add new attributes. Is it possible to delete an attribute without having to recreate the entire custom data class? I even tried deleting the column from the database and refreshing the console, but the darn attribute stayed in the view ;). Any ideas?

MBHarmon's picture

I don't believe it's possible

Solution

I don't believe it's possible to remove those unless you recreate the data class. 

- Matt

AltAdminNC's picture

Hidden Attribute

If you do not want to start again, I believe you can open the Data Class, edit the attribute (click the pencil icon) and mark it as Hidden. It will still be in the table, but won't show up in the resource it is assigned to.
I have to admit, the term "Editable" Data Class is a bit misleading.

EMercado's picture

I ended up recreating the

I ended up recreating the data class, but I will experiment with "hidden" option in the future. I agree,  they are using the term "editable" pretty loosely. :)

Mike.Langford's picture

Nope, Not Possible

I have run into the same thing a few times my self and have ended up just recreating them as well, but the hidden suggestion might be handy in the future.

btowne's picture

Yes, anything is possible

Just export the Data Class from the Console, edit the XML and reimport.

MBHarmon's picture

Great tip! Does that also

Great tip! Does that also remove the column from that table in SQL?

- Matt

Mike.Langford's picture

Is that a supported solution?

I had thought of that in the past, but thought it would be more of a hack than a fix. Does this only change what is displayed in the console or does it also edit the database?  And if it does edit the database, is this something that is approved of and supported?

Mike.Langford's picture

Just tried it...

I just tested it out on our test server and it actually didn't work.  Here is what I did.

  1. Created a custom data class and saved it.
  2. Exported it
  3. Edited the XML and changed the name of one of the fields in every location it appeared throughout the XML
  4. Reimported the XML.

Results:
Nothing changed in the console or the database.  The field name remained the same.

Oh well.  It was worth a try...

EMercado's picture

Thanks for the suggestions

If the export.->edit->re-import worked, I would've marked it as the Solution. Thanks Mike for testing that - I hadn't noticed new posts here until today.