Thursday, 10 July 2014

how to get access to parent record from the new entity record opened using the lookup view

I had a requirement where we got a lookup field on the entity form and on click of that lookup user is able to either select existing record or click on new record, the new record needs to have reference of some selects which user have specified in the initial form.

CRM passes the details of parent window in the url, and used the following code  to extract the id
 
var idMatch = (/currentid=([^&]+)/i).exec(parent.window.opener.location.search);

if (idMatch != null) {

var id = idMatch[1];

    id = id.replace("%7b", "");

    id = id.replace("%7d", "");

return id;



}

No comments:

Post a Comment