Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

CreateMetaField is not adding entry to mcmd_MetaField table

$
0
0

We're having an issue where the Business Foundation API for creating a new MetaField on a class is not working properly.

This is the code that I'm executing:

using (var myEditScope = DataContext.Current.MetaModel.BeginEdit())
{
	metaClass.CreateMetaField(name, friendlyName, typeName, isNullable, defaultValue ?? string.Empty, attributes);
	myEditScope.SaveChanges();
}

And this does create the column in the MetaClass's own SQL table, but it does not add an entry to the mcmd_MetaField table.

I've experimented with a few different approaches, and have tested it with various MetaFieldTypes (Integer, String, DateTime, etc) but keep getting the same result. I've double checked that I'm adding the correct attributes (I am checking against the MetaFieldBuiler code as a reference).

What really has me scratching my head is that this has always worked on previous projects reliably for me, and even in the early days of this project.. I guess maybe something is uniquely wrong with our state of data perhaps, but I can't figure what could have changed to cause this..?

We're using Commerce v12.11 (with CMS v11.10.6).

Anyone have any ideas/tips?


Viewing all articles
Browse latest Browse all 9076

Trending Articles