Recent twitter entries...

  •  

Open a new Window Centered

Posted by AnonymousDeveloper | Posted in Gosh, that's useful | Posted on 02-06-2009

0

An oldie but a goodie. How to open a centered window from an ISV button. Just add the following to the JavaScript element in ISV.config.

Code   
var width  = 400;
 var height = 200;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=no';
 params += ', status=no';
 params += ', toolbar=no';
window.open('../../ISV/ContractLineStatusChange.aspx?id=' + crmForm.ObjectId

var width  = 400;
 var height = 200;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=no';
 params += ', status=no';
 params += ', toolbar=no';
window.open('../../ISV/ContractLineStatusChange.aspx?id=' + crmForm.ObjectId + '&Status=' + crmForm.all.foc_paymentstatus.DataValue ,"ChangeContract", params);

Write a comment