Ecommerce Order Custom Field for Notes
Hi
I'm using Global.asax to add new fields to the Orders table....
I've used the example in the documentation to create a meta field which works fine:
// Add a new meta field to the Order table
App.WorkWith()
.DynamicData()
.Type(typeof(Order))
.Field()
.TryCreateNew("PurchaseNo", typeof(string))
.SaveChanges(true);
However I need to add a meta field for Notes
Using the above code creates a database field of type nvarchar(255)
Is there a way to create a meta field which will become nvarchar(max) in the database table?
Regards
Martin
Hello ,
Your code should look like the following to get the desired result:
App.WorkWith() .DynamicData() .Type(typeof(Order)) .Field() .TryCreateNew("Notes", typeof(string)) .Do(f => f.FieldName = "Notes"; f.ColumnName = "Notes"; f.Title = "Notes"; f.DBSqlType = "NVARCHAR(MAX)"; f.DBType = "LONGVARCHAR"; ) .Done().SaveChanges(true);Many thanks Ivaylo
That was perfect!
Field now correctly updates
Regards
Martin