Developer forum

Forum » Ecommerce - Standard features » Change type custom order field

Change type custom order field

Martin Moen
Reply

We have encountered a strange error related to custom order fields.

First we created a new custom order field "MyOrderField" with type "Checkbox". After a while we found out that this field needs to be a text field. And since we cant change the field type, we deleted the field and created a new one with the same system name but as "Text (50)".

But whenever we try to add values to this field it always store it as "true/false". So if we try to set a value of "TEST" it is saved as "true". If we leave it empty, it is stored as "false". I checked the DB, and the field type is "Text (50)" and in the admin it appears as a text field. But values are always only stored as "true/false".

Are there any caching, or does the initial type get stored somewhere? We could of course create a new field with a new system name, but we would like to keep it in the same way it was. Any help is appreciated.


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Martin

It sounds like the actual column in the database has not been removed - so you might need to go check the database schema.

BR Nicolai

 
Martin Moen
Reply

Looks like it is okay, only one field in the schema, and its a text field:

SELECT s.name as schema_name, t.name as table_name, c.* FROM sys.columns AS c
INNER JOIN sys.tables AS t ON t.object_id = c.object_id
INNER JOIN sys.schemas AS s ON s.schema_id = t.schema_id
WHERE t.name = 'EcomOrders' AND s.name = 'dbo'
AND c.Name = 'MyOrderField'

 

SCHEMA_NAME
TABLE_NAME
OBJECT_ID
NAME
COLUMN_ID
SYSTEM_TYPE_ID
USER_TYPE_ID
dbo  EcomOrders  1762105318  MyOrderField 191  231  231 

 

 

You must be logged in to post in the forum