How to recover a "has no database representation" field

Cristhian Caldas asked on May 12, 2016 00:57

I was creating an alterative form in E-commerce customer class; in this form i added a new field and when i saved this field, the CMS throw the following message:

"This field has no database representation."

After i added the alternative form to the checkout page and this form was displayed in the page and also the new field was displayed; but when i tried to recover the customer object on Checkout process; all the customer fields were recover except the new field that was created in the alternative form. How can i recover this kind of fields?

Recent Answers

Trevor Fayas answered on May 12, 2016 02:20

Alternate forms are just different visual forms for the same Database Table. If you add a new field on an alternate form, there's no column in the table to store that value.

These are only useful for things like custom controls to add functionality without saving any data, that's why the data was not able to recovered, it never got saved because it didn't have a place to save.

You will need to either add the field to the customer class itself first (it may allow additions), or create another form that has that field and store the value there, maybe a joining table.

2 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.