Adding a numeric field via migration

Topics: Writing modules
Aug 24, 2012 at 2:21 PM

Hey everyone,

I'm trying to add a numeric field to a content item but it doesn't show up in the admin when editing the content item, i also don't get any errors:

Here's my code in the migration, what could be wrong?

 ContentDefinitionManager.AlterPartDefinition("Student_Item", builder =>
                builder.WithField("Order",
                fieldBuilder => fieldBuilder
                .OfType("NumericField")
                .WithDisplayName("Order")));
Borrie

Aug 24, 2012 at 5:44 PM

Nevermind, I've solved it

Added:

ContentDefinitionManager.AlterTypeDefinition("Student_Item", builder =>
                builder.WithPart("Student_Item")

Also had to stop the asp.net development server (vs2010) and delete the mappings.bin for the changes to come through