SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,298 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
i have a event reveiver the itemupdated.how i add multiple values in hyperlink field. the part of my code is
string idponudesmestajZ = properties.ListItem["ID ПонудеСмештајЗ"] == null ? "" : properties.ListItem["ID ПонудеСмештајЗ"].ToString();
string sFileName = "document.docx"
SPList PonudeSmestajZbirno = web.Lists["Понуде - смештај (збирно)"];
SPList Sektor1Dokumenta = web.Lists["Сектор 1 - Документа"];
SPFolder folder = Sektor1Dokumenta.RootFolder;
SPFileCollection fcol = folder.Files;
string link = web.Url + "/" + fcol.Folder.Url + "/" + sFilename;
SPFieldUrlValue urlValue = new SPFieldUrlValue();
urlValue.Description = sFilename;
urlValue.Url = link;
SPQuery upit = new SPQuery();
upit.Query = "<Where><Eq>" + "<FieldRef Name='ID' />" + "<Value Type='Text'>" + idponudesmestajZ + "</Value>" + "</Eq>" + "</Where>";
SPListItemCollection kolekcijaponudesmestajzbirno = PonudeSmestajZbirno.GetItems(upit);
foreach (SPListItem ponuda in kolekcijaponudesmestajzbirno)
{
if(ponuda["Линк"] == "")
{
ponuda["Линк"] = urlValue;
ponuda.Update();
}else if (!(ponuda["Линк"] == ""))
{
//i don't know what i type here
}
}
Hi @gogi100 ,
No, it's not possible. In SharePoint, hyperlink field doesn't support multiple values.
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.