, , , foreach, Sitecore MultilistField , , foreach GetItems() '|' ?
/ Sitecore ID TryParse:
var subsidiariesIdList = new List<ID>();
MultilistField multilistField = newsItem.Fields["Recipient Subsidiaries"];
foreach (var item in multilistField)
{
ID id;
if (Sitecore.Data.ID.Parse(item.ToString(), out id))
{
subsidiariesIdList.Add(id);
}
:
MultilistField multilistField = newsItem.Fields["Recipient Subsidiaries"];
if (multilistField != null && multilistField.Count > 0)
{
var subsidiariesIdList = multilistField.GetItems().Select(i=>i.ID).ToList<ID>();
}
Enjoy.
P.s. , iPhone.