CHUVASH.eu
  • About
  • Search
X GitHub
Bypass all custom jslink
Posts

Bypass all custom jslink

Anatoly Mironov

December 8, 2014

bypasscustomjslink-001

Client Side Rendering (CSR) and jslink are great for customizing lists and forms in SharePoint. In my current project we use it a lot of it. A disadvantage of that path, although, is that it might occur javascript errors, during the development phase, but also in production. We do, of course, our best to leverage the best jslink code, but unfortunately we have to live with the fact that errors can occur, especially when we use it for NewForm, EditForm, DisplayForm and View (in list and grid). If an error occurs, it won’t stop the rest of javascript (it is wrapped in try and catch by SharePoint), but the fields will still not function as intended. It can also be some “corrupt” or old data in the field value that will “break” the jslink code. I would like to suggest one little fix, an idea I’ve come up to in my jslink-heavy project:

Use a custom url parameter to stop all custom jslink execution.

The query string parameter can be called bypasscustomjslink=true In every custom jslink, start with this line of code:

any jslink file

(function () {
  if (GetUrlKeyValue("bypasscustomjslink") === "true") {
    return;
  }
})();

That’s it. If you have this in place, you can just manually add this to your url in browser:

?bypasscustomjslink=true

or

&bypasscustomjslink=true

Then all the customized fields and views will be uncustomized until bypasscustomjslink=true is removed. While viewing and editing list items in this uncustomized mode, you can access and repair data as if you never had adjusted it with jslink. Using this does not mean you can “relax” and start writing crappy code. You still have to produce good code and anticipate all possible errors. bypasscustomjslink is just a convenient “emergency exit” aimed for developers and support to quickly solve problems without needing to reset the JSLink property on fields and list views.

  • Best Practice
  • Csr
  • Javascript
  • Jslink
  • Sharepoint
  • Sharepoint2013
  • Tips
  • Url

Related

  • Client Side Rendering with Async dependencies
  • Drag and Drop Image using Client Side Rendering
  • Disabling a column in Quick Edit
  • JSGrid Basics
  • Improving the web performance of an intranet
  • Do not mess with the hive
  • AppLoader Concept for SharePoint apps
  • javascript: Remove illegal characters in url
  • Make javascript code work with Minimal Download Strategy Part 1
  • GeoLocation Field in SharePoint 2013
  • Toastr.js and SharePoint
  • Parameterize a javascript object and create url
  • Showing Birthdays and Job Anniversaries in the Newsfeed
  • Configuring VirtualBox for SharePoint-Hosted Apps
  • Updating hover style in IE8 Developer Tools
© CHUVASH.eu 2026
X GitHub