Category Archives: Passing Calling User to an Aspx Page from Sitemap

Passing Calling User to an Aspx Page from Sitemap in CRM 2011

How to Pass the Calling User to an Aspx Page from Sitemap in CRM 2011

First, you need to create a simple HTML file and put the following codes in that page. Add the HTML file into the web resource. Call that file from your Sitemap. By the way, don’t forget to redirect to your aspx page in the HTML file. 🙂

<HTML><HEAD><TITLE></TITLE></HEAD>
<BODY onload=redirectAspxPage(); contentEditable=true>
<SCRIPT type=text/javascript src=”../ClientGlobalContext.js.aspx”></SCRIPT>

<SCRIPT type=text/javascript>
function redirectAspxPage() {

var userid = window.parent.Xrm.Page.context.getUserId();

window.location.href = “http://YOUR_URL/YOUR_PAGE.aspx?userid= ” + userid;
}
</SCRIPT>
</BODY></HTML>

Advertisement

2 Comments

Filed under Passing Calling User to an Aspx Page from Sitemap