I have been working on a problem for a bit now, and coming back to it again. I have most of it taken care of, thanks to previously posted questions https://sitecore.stackexchange.com/questions/13094/sitecore-7-2-parsing-a-droplink-field-in-viewmodel?noredirect=1#comment20043_13094, but I am still having an issue getting the needed value out of the droplink field.
I have a field template, called EventInfo, which has two properties, EventName and EventGuidNumber. Both are single-line text field types.
EventName has the acronym we use for the event, EventGuidNumber has the GUID our association management DB has for the event. I am trying to use the EventGuidNumber in our custom event code, to dynamically pull schedules, speakers, attendees, etc.
The EventInfo field template is used in the droplink field called NetForumID.
The NetForumID droplink uses the list of eventinfo items as the data source.
The NetForumID droplink is part of the overall Event template.
Here is a section of code from the model:
[SitecoreType(TemplateId = "{C65FF46A-5E22-48E1-BB73-D0B2A82AD691}", AutoMap = true)] /*Event ID template*/
public class EventIdDropdown
{
[SitecoreField("NetForumId")]
public virtual Guid Id { get; set; }
public virtual NetForumEvent NetForumId { get; set; }
}
[SitecoreType(TemplateId = "{36371859-7FF2-47D0-86F1-1579416AA584}", AutoMap = true)]
public class Event
{
public virtual EventIdDropdown EventGuidNumber { get; set; }
}
When I test it, the correct property GUID shows up in EventIdDropdown Id, but NetForumId remains null. I have tried using various permutations of code, including changing NetforumId to EventGuidNumber, and changing the template from the existing GUID (which points to the template EventInfo) to the GUID for the overall Event template. In each case, the result is the same - EventIdDropdown.Id has a GUID value, EventIdDropdown.NetForumId remains null.
We are on Sitecore7.2 and using GlassMapper 3.
What am I missing? To me, the issue appears to be that I am not hooking into the actual value of the droplink, EventGuidNumber, correctly, but I am stumped on what else to try.
Thanks in advance!