Ecommerce Order Custom Field for Notes - Ecommerce - Ecommerce - Progress Community

Ecommerce Order Custom Field for Notes

 Ecommerce

Ecommerce Order Custom Field for Notes

  • 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 Martin,

    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);


    Regards,
    Ivaylo Angelov
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  • Many thanks Ivaylo

    That was perfect!

    Field now correctly updates

     Regards

    Martin