London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
I think you can use only the registered type and it might not be possible to update the lenght.
Here you can see meta field type meta information
Mediachase.BusinessFoundation.Data.Meta.Management.MetaFieldType
What if you manually update in DB? Is that working?
The "correct" attribute name is McDataTypeAttribute.StringMaxLength, however I think that can only be applied when you create a new metafield. Once you created the field you can't just change the length of the column
Hi
I need to change the max length for a field in Contact. The field is a string...
I tested this.
using (MetaClassManagerEditScope scope = DataContext.Current.MetaModel.BeginEdit("Contact", AccessLevel.System)) { MetaFieldCollection fields = DataContext.Current.MetaModel.MetaClasses["Contact"].Fields; var fieldToChange = fields["MyField"]; fieldToChange.Attributes["MyField"] = 4000; scope.SaveChanges(); }
But didnt work. Checked the field in DB in table cls_Contact and the length is the same as before.
Do I must to change it manually?