I have been working with window.showModalDialog to show custom aspx page on click on button in CRM 2011 and passing sharedObject to ModalDilog, But when I try to get sharedObject at ModalDilog I am getting undefined.
any suggestions,help...
code for Parent page
function ShowModal () {
var formule = document.getElementById ("conditiondetails");
var sharedObject = {};
sharedObject.formule = formule.value;
if (window.showModalDialog) {
var retValue = showModalDialog ("http://uvo1jn2qrsoxiamwd5x.vm.cld.sr:8080/GhatanaPluginConfiguration.aspx", sharedObject, "dialogWidth:200px; dialogHeight:200px; dialogLeft:300px;");
if (retValue) {
UpdateFields (retValue.formule);
}
}
else {
// for similar functionality in Opera, but it's not modal!
var modal = window.open ("http://uvo1jn2qrsoxiamwd5x.vm.cld.sr:8080/GhatanaPluginConfiguration.aspx", null, "width=300,height=300,left=300,modal=yes,alwaysRaised=yes", null);
modal.dialogArguments = sharedObject;
}
}
code for Child page
<script type="text/javascript">function Init() {
var sharedObject = window.dialogArguments;
var formule = document.getElementById("TextBox1");
formule.value = sharedObject.formule;
}
function OnOK() {
var formule = document.getElementById("TextBox1");
if (window.showModalDialog) {
var sharedObject = {};
sharedObject.formule = formule.value;
window.returnValue = sharedObject;
}
else {
// if not modal, we cannot use the returnValue property, we need to update the opener window
window.opener.UpdateFields(formule.value);
}
window.close();
}
function OnCancel() {
window.close();
}
</script>
Thanks Regards Prashanth Kamasamudram Even the least work done for others awakens the power within; even thinking the least good of others gradually instills into the heart the strength of a lion.