Skip to main content
deleted 133 characters in body
Source Link

Note:

in June 2017, Microsoft disabled the use of JavaScript in a Calculated Column

That means given answers may not apply for newer SharePoint versions

For long explanation and work arounds see:
June 13th 2017 Microsoft blocked handling HTML markup in SharePoint calculated fields - how to get the same functionality back


**Original answer:**

Read the Pros & Cons at : http://www.viewmaster365.com/#/How

  • Create a Calculated Column View

  • set Datatype=Number (will output String as HTML)

  • Add the Formula:

      ="<a href='#' onclick=""{event.stopPropagation();"
      &"var ID=getItemIDFromIID(findIIDInAncestorNode(this)),"
      &"url=_spPageContextInfo.serverRequestPath.replace(/[^\/]*$/gi,'');"
      &"this.parentNode.innerHTML='Opening:'+ID;"
      &"document.location=url+'DispForm.aspx?ID='+ID;"
      &"}""><img src='/_layouts/images/VIEWREPORTSHH.png' width='20px'></a>"
    

Onclick it captures the ID value from the TR node
Builts the correct url
Displays a message (every click in a webpage should give an immediate response IMHO)
goes to the url

I am not 100% sure if those IID functions exist in 2010, if not see the examples below for alternative code

More:

ICC

Note:

in June 2017, Microsoft disabled the use of JavaScript in a Calculated Column

That means given answers may not apply for newer SharePoint versions

For long explanation and work arounds see:
June 13th 2017 Microsoft blocked handling HTML markup in SharePoint calculated fields - how to get the same functionality back


**Original answer:**

Read the Pros & Cons at : http://www.viewmaster365.com/#/How

  • Create a Calculated Column View

  • set Datatype=Number (will output String as HTML)

  • Add the Formula:

      ="<a href='#' onclick=""{event.stopPropagation();"
      &"var ID=getItemIDFromIID(findIIDInAncestorNode(this)),"
      &"url=_spPageContextInfo.serverRequestPath.replace(/[^\/]*$/gi,'');"
      &"this.parentNode.innerHTML='Opening:'+ID;"
      &"document.location=url+'DispForm.aspx?ID='+ID;"
      &"}""><img src='/_layouts/images/VIEWREPORTSHH.png' width='20px'></a>"
    

Onclick it captures the ID value from the TR node
Builts the correct url
Displays a message (every click in a webpage should give an immediate response IMHO)
goes to the url

I am not 100% sure if those IID functions exist in 2010, if not see the examples below for alternative code

More:

ICC

Note:

in June 2017, Microsoft disabled the use of JavaScript in a Calculated Column

That means given answers may not apply for newer SharePoint versions

For long explanation and work arounds see:
June 13th 2017 Microsoft blocked handling HTML markup in SharePoint calculated fields - how to get the same functionality back


**Original answer:**
  • Create a Calculated Column View

  • set Datatype=Number (will output String as HTML)

  • Add the Formula:

      ="<a href='#' onclick=""{event.stopPropagation();"
      &"var ID=getItemIDFromIID(findIIDInAncestorNode(this)),"
      &"url=_spPageContextInfo.serverRequestPath.replace(/[^\/]*$/gi,'');"
      &"this.parentNode.innerHTML='Opening:'+ID;"
      &"document.location=url+'DispForm.aspx?ID='+ID;"
      &"}""><img src='/_layouts/images/VIEWREPORTSHH.png' width='20px'></a>"
    

Onclick it captures the ID value from the TR node
Builts the correct url
Displays a message (every click in a webpage should give an immediate response IMHO)
goes to the url

I am not 100% sure if those IID functions exist in 2010, if not see the examples below for alternative code

More:

ICC

added 395 characters in body
Source Link

Note:

in June 2017, Microsoft disabled the use of JavaScript in a Calculated Column

That means given answers may not apply for newer SharePoint versions

For long explanation and work arounds see:
June 13th 2017 Microsoft blocked handling HTML markup in SharePoint calculated fields - how to get the same functionality back


**Original answer:**

Read the Pros & Cons at : http://www.viewmaster365.com/#/How

  • Create a Calculated Column View

  • set Datatype=Number (will output String as HTML)

  • Add the Formula:

      ="<a href='#' onclick=""{event.stopPropagation();"
      &"var ID=getItemIDFromIID(findIIDInAncestorNode(this)),"
      &"url=_spPageContextInfo.serverRequestPath.replace(/[^\/]*$/gi,'');"
      &"this.parentNode.innerHTML='Opening:'+ID;"
      &"document.location=url+'DispForm.aspx?ID='+ID;"
      &"}""><img src='/_layouts/images/VIEWREPORTSHH.png' width='20px'></a>"
    

Onclick it captures the ID value from the TR node
Builts the correct url
Displays a message (every click in a webpage should give an immediate response IMHO)
goes to the url

I am not 100% sure if those IID functions exist in 2010, if not see the examples below for alternative code

More:

ICC

Read the Pros & Cons at : http://www.viewmaster365.com/#/How

  • Create a Calculated Column View

  • set Datatype=Number (will output String as HTML)

  • Add the Formula:

      ="<a href='#' onclick=""{event.stopPropagation();"
      &"var ID=getItemIDFromIID(findIIDInAncestorNode(this)),"
      &"url=_spPageContextInfo.serverRequestPath.replace(/[^\/]*$/gi,'');"
      &"this.parentNode.innerHTML='Opening:'+ID;"
      &"document.location=url+'DispForm.aspx?ID='+ID;"
      &"}""><img src='/_layouts/images/VIEWREPORTSHH.png' width='20px'></a>"
    

Onclick it captures the ID value from the TR node
Builts the correct url
Displays a message (every click in a webpage should give an immediate response IMHO)
goes to the url

I am not 100% sure if those IID functions exist in 2010, if not see the examples below for alternative code

More:

ICC

Note:

in June 2017, Microsoft disabled the use of JavaScript in a Calculated Column

That means given answers may not apply for newer SharePoint versions

For long explanation and work arounds see:
June 13th 2017 Microsoft blocked handling HTML markup in SharePoint calculated fields - how to get the same functionality back


**Original answer:**

Read the Pros & Cons at : http://www.viewmaster365.com/#/How

  • Create a Calculated Column View

  • set Datatype=Number (will output String as HTML)

  • Add the Formula:

      ="<a href='#' onclick=""{event.stopPropagation();"
      &"var ID=getItemIDFromIID(findIIDInAncestorNode(this)),"
      &"url=_spPageContextInfo.serverRequestPath.replace(/[^\/]*$/gi,'');"
      &"this.parentNode.innerHTML='Opening:'+ID;"
      &"document.location=url+'DispForm.aspx?ID='+ID;"
      &"}""><img src='/_layouts/images/VIEWREPORTSHH.png' width='20px'></a>"
    

Onclick it captures the ID value from the TR node
Builts the correct url
Displays a message (every click in a webpage should give an immediate response IMHO)
goes to the url

I am not 100% sure if those IID functions exist in 2010, if not see the examples below for alternative code

More:

ICC

replaced http://sharepoint.stackexchange.com/ with https://sharepoint.stackexchange.com/
Source Link

Read the Pros & Cons at : http://www.viewmaster365.com/#/How

  • Create a Calculated Column View

  • set Datatype=Number (will output String as HTML)

  • Add the Formula:

      ="<a href='#' onclick=""{event.stopPropagation();"
      &"var ID=getItemIDFromIID(findIIDInAncestorNode(this)),"
      &"url=_spPageContextInfo.serverRequestPath.replace(/[^\/]*$/gi,'');"
      &"this.parentNode.innerHTML='Opening:'+ID;"
      &"document.location=url+'DispForm.aspx?ID='+ID;"
      &"}""><img src='/_layouts/images/VIEWREPORTSHH.png' width='20px'></a>"
    

Onclick it captures the ID value from the TR node
Builts the correct url
Displays a message (every click in a webpage should give an immediate response IMHO)
goes to the url

I am not 100% sure if those IID functions exist in 2010, if not see the examples below for alternative code

More:

ICC

Read the Pros & Cons at : http://www.viewmaster365.com/#/How

  • Create a Calculated Column View

  • set Datatype=Number (will output String as HTML)

  • Add the Formula:

      ="<a href='#' onclick=""{event.stopPropagation();"
      &"var ID=getItemIDFromIID(findIIDInAncestorNode(this)),"
      &"url=_spPageContextInfo.serverRequestPath.replace(/[^\/]*$/gi,'');"
      &"this.parentNode.innerHTML='Opening:'+ID;"
      &"document.location=url+'DispForm.aspx?ID='+ID;"
      &"}""><img src='/_layouts/images/VIEWREPORTSHH.png' width='20px'></a>"
    

Onclick it captures the ID value from the TR node
Builts the correct url
Displays a message (every click in a webpage should give an immediate response IMHO)
goes to the url

I am not 100% sure if those IID functions exist in 2010, if not see the examples below for alternative code

More:

ICC

Read the Pros & Cons at : http://www.viewmaster365.com/#/How

  • Create a Calculated Column View

  • set Datatype=Number (will output String as HTML)

  • Add the Formula:

      ="<a href='#' onclick=""{event.stopPropagation();"
      &"var ID=getItemIDFromIID(findIIDInAncestorNode(this)),"
      &"url=_spPageContextInfo.serverRequestPath.replace(/[^\/]*$/gi,'');"
      &"this.parentNode.innerHTML='Opening:'+ID;"
      &"document.location=url+'DispForm.aspx?ID='+ID;"
      &"}""><img src='/_layouts/images/VIEWREPORTSHH.png' width='20px'></a>"
    

Onclick it captures the ID value from the TR node
Builts the correct url
Displays a message (every click in a webpage should give an immediate response IMHO)
goes to the url

I am not 100% sure if those IID functions exist in 2010, if not see the examples below for alternative code

More:

ICC

added 113 characters in body
Source Link
Loading
simplified Formula
Source Link
Loading
Source Link
Loading