web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Open Dialog via JavaScript (Window size)

(0) ShareShare
ReportReport
Posted on by 12,163

So I am using this javascript (pulled from MSDN) to open a Dialog via an onchange event on a field.

function openDialogProcess(dialogId, entityName, objectId)
{
var url = Xrm.Page.context.getClientUrl() +
  "/cs/dialog/rundialog.aspx?DialogId=" +
  dialogId + "&EntityName=" +
  entityName + "&ObjectId=" +
  objectId;
window.open(url);
}

 

Everything works great, except the problem I am having is that the Dialog opens in a new tab in the browser where I would prefer the default Dialog "popup" window. I tried playing around with the window.open parameters and was able to get it to pop out but it seems locked in to a certain size and I can't change it.

This is what I tried using window.open(url, height=200, width=150)

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Aiden Kaskela Profile Picture
    19,696 on at

    Hi Joe,

    You want to put quotes around your parameters so it's all passed in as one in the third parameter, with the second parameter being the window name (blank in this example). Update your command so it's like this:

    window.open(url, "", "height=200, width=150")

    Hope this helps! I'd appreciate if you'd mark this as a Verified answer.

    Thanks,

     Aiden

  • Joe Woltering Profile Picture
    12,163 on at

    Ah, brilliant. Thanks Aiden!

  • Robert Fleminks Profile Picture
    on at

    Hi Joe,

    I am working with this code and I think I almost got it working. The only problem is that I have to enter URL it seems.

    Can you help me with which URL and where I put it?

    Much appreciated!

  • Robert Fleminks Profile Picture
    on at

    I am progressing! Now I do get the correct Dialogue to pop up in a window. However the objectID refers to a record but I want it to point out to the record for which the Dialogue is opening.. any advise?

  • Community Member Profile Picture
    on at

    Hi Everyone,

    I started reading dialog and how to take input from user. Im trying to figure out that I want to take inputs from user on click of button (with help of Dialog). 

    I want to access those input values given by user using javascript.

    Can you tell me how to achieve this with an example?

    Thank you

  • sathish1109 Profile Picture
    110 on at

    How did you get the object id of a specific dialog.?

  • Suggested answer
    R.Seiffert Profile Picture
    120 on at

    I think you just have to open the Dialog via Settings>Processes and them check the URL of the Dialog. There should be something in it like [Organisations-URL]/sfa/workflow/edit.aspx?id= and then everything after that should be the ID of your Dialog.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans