Custom module get items by State
I created custom module to display locations. I'm using data type "Address". So it's easy to add a location. However when I try to get items by location, I don't know how.
var myLocations = dynamicModuleManager.GetDataItems(rmylocationType)
.Where(d => d.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live
&& (?? I don't know this part. GetValue<Address>>????)
Hi,
You have detailed code reference for each of your modules located under Administration->Module Builder->Your module-> Code Reference for Your module. The correct way for you to get the field in question is presented below.
DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager();
Type MyType = TypeResolutionService.ResolveType(
"Telerik.Sitefinity.DynamicTypes.Model.YourModuleName.YourContentTypeName"
);
var TheType= dynamicModuleManager.GetDataItems(MyType).FirstOrDefault();
var MyField = TheType.GetValue(
"FieldName"
);