Hey Everyone,
I've run into an issue where the previous admin created a calculated column in a content type that is used by over 100 sites. The calculated column works properly, except for the fact that in this Library, folders aren't able to open.
The calculated column's formula uses document ID's but as we know folders don't have document IDs.
That being said, when trying to open these folders by clicking within the column, throws an error.
The code below is the calculated column's formula
="<script type='text/javascript'>"&" var buildURL = '/_layouts/DocIdRedir.aspx?ID="&[Document ID Value]&"';"&" var target = '_blank';"&" var innerHTML = '<a href=' + buildURL + ' target=' + target + '>"&Title&"</a>';"&"document.write(innerHTML);"&"</script>"
I believe this below is a good start, but I am at the point where I need to change the URL - to some script that pulls the folder URL.
=IF(ISBLANK([Document ID]),"<a href='http://site/library/"&Title&"'>"&Title&"</a>","<script type='text/javascript'>"&"var buildURL = '/_layouts/DocIdRedir.aspx?ID="&[Document ID Value]&"';"&" var target = '_blank';"&"var innerHTML = '<a href=' + buildURL + ' target=' + target + '>"&Title&"</a>';"&"document.write(innerHTML);"&"</script>")
Thanks to Thriggle https://social.technet.microsoft.com/profile/thriggle/?ws=usercard-mini
for coming up with this code.
Can someone please help?