Targeting a Panel via URL (or: How to Idiot-Proof Notifications)

14 12 5,104


Panels never change.

But what DOES change is who can see them, and when. This is what initiated my most recent client request: "Make sure that when the Manager goes into the form, that they can only see the Manager panel, and the Software panel - and not the other two." 

"Simple!" I replied. Our panels are JavaScript controlled beauties; a sight to behold. Easy to hide using Nintex rules.

I spoke too soon.

"Also," they began, "Ensure that the Manager is taken directly to the Manager panel when they open their notification link."

My endless Googling and Nintexoogling of "target panel" was fruitless; if nothing else, I hope this blog will cement the words "target panel" forever in the search terms so that I can help future Rhias of the world come to this solution:

Step 1) Determine your code word. For me, it was "managers" and "software". We will focus on "managers" for this example.

Step 2) Ye olde JavaScript. Plop this into your Custom JavaScript settings:

NWF$( document ).ready(function() {
  if("manager") > -1) {

Explanation: This JS looks at the URL, and checks to see if the word "manager" is in it. If it is, it runs the JS function "showPanelManager()" which is what controls our Manager panel.

Step 3) In your workflow, wherever the URL is going to be doled out to a manager, append either:

               a) If after .aspx, add a ?manager (.aspx?manager)

               b) If after other data (such as ID=360), add an &manager (ID=360&manager)

And, simple as that, you can now send your user directly to whichever panel is appropriate to them.

AND ... even if you don't need this ... think of all the cool things you could do by using a URL in this way! Append a word, and magically run ANY function! NEAT.

Any questions? Comments? Let me know! I'd also like to hear of the better ways to accomplish this - I am sure they exist - as well as your ideas for how else this could be used.