Determining Identifier Field For Dynamic Module Type

Posted by Community Admin on 04-Aug-2018 21:16

Determining Identifier Field For Dynamic Module Type

All Replies

Posted by Community Admin on 23-Oct-2015 00:00

Hi,

I'm trying to find the field specified as the identifier for a content type using ModuleBuilderManager but can't figure it out. I thought there would be a flag on DynamicModuleField to indicate it but I can't find it.

 

Thank you.

 

Michael

Posted by Community Admin on 26-Oct-2015 00:00

Figured it out.

var mbm = ModuleBuilderManager.GetManager();
var mtype = mbm.Provider.GetDynamicModuleTypes().Where(t => t.TypeName.EndsWith("[CONTENT ITEM NAME]")).FirstOrDefault();
var identifier = mtype == null ? String.Empty : mtype.MainShortTextFieldName;

 

Thank me!

This thread is closed