sharepoint-2010sharepoint-webservice

columns dereferencing in SharePoint's calculated column


I want to use the simple formula:

="FIX_" & [ID]

The issue with this formula occurs when I confirm the calculated function, the formula appears to revert back to:

="FIX_" & ID

The problem is now that these are no longer referencing the [ID] column so the result returns

"FIX_"

for all records. This does work for the first record entered but any other subsequent entries display this error.

Is this a known issue?


Solution

  • So you only want to display the link in a VIEW.

    You can then use HTML/JavaScvript in a Calculated Column to extract the correct ID from the HTML TR table row and create the href attribute.

    Create a Calculated Columns, and set the datatype to Number!

    Paste the Formula (as is, including & characters, line breaks will be ignored):

    ="<div ""style=text-align:left""><a><img src=""/_layouts/images/blank.gif"" onload=""{"
    &"var row=this;while(row.tagName!='TR'){row=row.parentNode;}"
    &"var ID=row.id.split(',')[1];"
    &"this.parentNode.href='v://database//FIX_'+ID;"
    &"}"">database folder</a></div>"
    

    Note: the outer div is added because a Number column is aligned to the Right.

    This only works in VIEWS! Not on FORMS!