Try our conversational search powered by Generative AI!

Deleting a field in a business object that has been created via code

Vote:
 

Hey all, I need to edit a field from a business object but can't seem to access the editing & deleting function (http://webhelp.episerver.com/latest/commerce/business-foundation/customizing-a-business-object.htm). In code I thought I could delete it and then recreated in in an MetaData initilization class, but 

orgMeta.Fields.Remove("");

removes the field from commerce manger but it doesn't remove it from the db so there's an error when recreating it after. This is fine on local, but surely there's an easier way.

Thanks

#201817
Mar 04, 2019 12:29
Vote:
 

I'd suggest to go with MetaClass.DeleteMetaField(MetaField), which not only removes the field from the MetaClass, but actually deletes it.

#201818
Mar 04, 2019 12:35
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.