More in this section
Forums / Developing with Sitefinity / Determining Identifier Field For Dynamic Module Type

Determining Identifier Field For Dynamic Module Type

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 1 answered
  1. Michael
    Michael avatar
    2 posts
    Registered:
    23 Oct 2015
    23 Oct 2015
    Link to this post

    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

  2. Michael
    Michael avatar
    2 posts
    Registered:
    23 Oct 2015
    26 Oct 2015
    Link to this post

    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!

    Answered
2 posts, 1 answered