1

im trying to open a new window with a fixed size, but instead it open up in a new tab? Im sure why this is, here is my code below.

function opendialog() {

// If on a create form then save and reload so the dialog can open
if(Xrm.Page.ui.getFormType() == 1)
{
    Xrm.Page.data.entity.save(null);
    return;
}

// If sale appointment then trigger dialog
if (Xrm.Page.getAttribute("new_PhoneCallMade").getValue() == true) {

    window.open("/" + Xrm.Page.context.getOrgUniqueName() + "/cs/dialog/rundialog.aspx?DialogId=%1111111111111111111%7d&EntityName=appointment&ObjectId=" + Xrm.Page.data.entity.getId());
    window.resize(500,500);

    // Set as being displayed so it doesn't trigger again on load
    Xrm.Page.getAttribute("new_PhoneCallMade").setValue(true);

}
}

function opendialogonload() {

if (Xrm.Page.getAttribute("new_PhoneCallMade").getValue() == null
  || Xrm.Page.getAttribute("new_PhoneCallMade").getValue() == false) {
    opendialog();
}
}`
AndroidAL
  • 1,111
  • 4
  • 15
  • 35
  • You might want to take a look at [http://stackoverflow.com/questions/726761/javascript-open-in-a-new-window-not-tab](http://stackoverflow.com/questions/726761/javascript-open-in-a-new-window-not-tab), this question has been asked before – neilsimp1 Oct 02 '15 at 14:32

1 Answers1

3

I think that you have to give a parameter to the window (width/height).

window.open(url, windowName, "height = 400, width = 200");

Try it here: http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_open2

Véronique
  • 138
  • 9