locked
MS CRM 2011 ONLINE - Dialog won't start RRS feed

  • Question

  • I want to start a dialog by JavaScript with this script.
    window.open("/" + Xrm.Page.context.getOrgUniqueName() + "/cs/dialog/rundialog.aspx?DialogId=%7b29D672A3-DAF7-4E7B-B771-F9472005FE1F%7d&EntityName=salesorder&ObjectId=" + Xrm.Page.data.entity.getId());

    All I get is just new window with text page not found. The url is this:
    https://x.x.x.com/x/cs/dialog/rundialog.aspx?DialogId=%7b29D672A3-DAF7-4E7B-B771-F9472005FE1F%7d&EntityName=salesorder&ObjectId={55B3279C-FE07-E311-8561-3C4A92DBDC37}

    The dialog is tested and working.
    Thursday, August 29, 2013 8:03 AM

Answers

  • So then take out the orgName from the URL?

    var id = Xrm.Page.data.entity.getId().replace("{", "").replace("}", "");
    window.open("cs/dialog/rundialog.aspx?DialogId=%7b29D672A3-DAF7-4E7B-B771-F9472005FE1F%7d&EntityName=salesorder&ObjectId=" + id);

    Note: Tested working.

    Paul


    If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".

    Twitter LinkedIn Facebook Blog Magnetism




    Thursday, August 29, 2013 9:18 AM

All replies

  • Why don't you just try hardcoding the URL?

    window.open("https://URL/orgname/cs/dialog/rundialog.aspx?DialogId=%7b29D672A3-DAF7-4E7B-B771-F9472005FE1F%7d&EntityName=salesorder&ObjectId=" + Xrm.Page.data.entity.getId());

    You are also referring to an Entity, so make sure the current context is referring to it when you run the command (inside the Entity or having it selected).

    Thursday, August 29, 2013 8:17 AM
  • You need to take the brackets out of the record ID, eg:

    var id = Xrm.Page.data.entity.getId().replace("{", "").replace("}", "");
    window.open("/" + Xrm.Page.context.getOrgUniqueName() + "/cs/dialog/rundialog.aspx?DialogId=%7b29D672A3-DAF7-4E7B-B771-F9472005FE1F%7d&EntityName=salesorder&ObjectId=" + id;


    Paul


    If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".

    Twitter LinkedIn Facebook Blog Magnetism

    Thursday, August 29, 2013 8:28 AM
  • Why don't you just try hardcoding the URL?

    window.open("https://URL/orgname/cs/dialog/rundialog.aspx?DialogId=%7b29D672A3-DAF7-4E7B-B771-F9472005FE1F%7d&EntityName=salesorder&ObjectId=" + Xrm.Page.data.entity.getId());

    You are also referring to an Entity, so make sure the current context is referring to it when you run the command (inside the Entity or having it selected).

    Well it is the same thing. Not helped.

    On the url, threre are the brackets. Is that the problem?

    {55B3279C-FE07-E311-8561-3C4A92DBDC37}

    Thursday, August 29, 2013 8:33 AM
  • You need to take the brackets out of the record ID, eg:

    var id = Xrm.Page.data.entity.getId().replace("{", "").replace("}", "");
    window.open("/" + Xrm.Page.context.getOrgUniqueName() + "/cs/dialog/rundialog.aspx?DialogId=%7b29D672A3-DAF7-4E7B-B771-F9472005FE1F%7d&EntityName=salesorder&ObjectId=" + id;


    Paul


    If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".

    Twitter LinkedIn Facebook Blog Magnetism

    Nope, I still get http 404 error.

    I noticed that the url which gives the 404 error is https://test.crm4.dynamics.com/test/cs.... but if I manually remove /test from the url like this https://test.crm4.dynamics.com/cs... then the dialog starts.

    Thursday, August 29, 2013 9:12 AM
  • So then take out the orgName from the URL?

    var id = Xrm.Page.data.entity.getId().replace("{", "").replace("}", "");
    window.open("cs/dialog/rundialog.aspx?DialogId=%7b29D672A3-DAF7-4E7B-B771-F9472005FE1F%7d&EntityName=salesorder&ObjectId=" + id);

    Note: Tested working.

    Paul


    If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".

    Twitter LinkedIn Facebook Blog Magnetism




    Thursday, August 29, 2013 9:18 AM
  • So then take out the orgName from the URL?

    var id = Xrm.Page.data.entity.getId().replace("{", "").replace("}", "");
    window.open("cs/dialog/rundialog.aspx?DialogId=%7b29D672A3-DAF7-4E7B-B771-F9472005FE1F%7d&EntityName=salesorder&ObjectId=" + id);

    Note: Tested working.

    Paul


    If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".

    Twitter LinkedIn Facebook Blog Magnetism




    Yes, I got it myself too. Thanks!
    Thursday, August 29, 2013 9:32 AM