Quantcast
Viewing all articles
Browse latest Browse all 82002

Accessing Parent window attribute from child window's Iframe CRM 2011

Hi,

I have a parent form which opens a child window on click of a ribbon button.

This child window has an iframe which has got ok and cancel button.

Now on click of ok i want to set a value from child window to parent window.

i have tried many methods to access parent window.

Below is my Ok click code

function saveOnClickOfOk(){

toUser = parent.Xrm.Page.getAttribute("vsds_touser");

if(toUser.getValue()){

var lookup = new Array();

lookup[0] = new Object();

lookup[0].id = toUser.getValue()[0].id;

lookup[0].name = toUser.getValue()[0].name;

lookup[0].entityType = toUser.getValue()[0].entityType;

window.top.opener.parent.Xrm.Page.getAttribute("vsds_assignedto").setValue(lookup);

}

parent.Xrm.Page.data.entity.save("saveandclose");

       }    

Please suggest a solution


Viewing all articles
Browse latest Browse all 82002

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>