Service Portal: redirect from old portal to new portal

pull the following widget into your OLD portal home page to redirect to your NEW one:

admin can override if they wish to, and toggled on/off via a sys property pulled in via the server script.


HTML

<div> REDIRECT TO NEW PORTAL </div>




CLIENT CONTROLLER

function($scope, $location) { /* widget controller */ var c = this; if (c.data.redirect) { var bProceed = false; if (c.data.isAdmin) { bProceed = confirm('redirect to new portal?'); } else { bProceed = false; } if (bProceed) { c.url = "/new_portal"; $location.url(c.url); } } }









SERVER SCRIPT

(function() { /* populate the 'data' object */ /* e.g., data.table = $sp.getValue('table'); */ data.redirect = false; data.redirect = (gs.getProperty('portal.old.redirect') == "true"); data.isAdmin=gs.hasRole("admin"); })();

Comments

Popular posts from this blog

GlideRecord setValue

Running transform maps asynchronously

variable advanced reference qualifier example