locked
issue opening a native crm lookup form using window.showmodaldialog... RRS feed

  • Question

  • hi all,

    I have created a ribbon button, onclick of it am opening a native crm form using window.showmodaldialog. my code is as follows,


    function opendialog() {
        //alert("Hi");
    var url=Xrm.Page.context.getServerUrl();
    var user=Xrm.Page.context.getUserId();
         var url = url + "_controls/lookup/lookupinfo.aspx?AllowFilterOff=1&DefaultType=9&DisableQuickFind=1&DisableViewPicker=1&LookupStyle=Single&ShowNewButton=0&ShowPropButton=0&browse=0&objecttypes=9";

          var lookUp = window.showModalDialog(url,"", "width=400px,resizable=1,height=500px,menubar=0,status=1,location=0,toolbar=0,scrollbars=1");
        // var lookUp = Xrm.Utility.openWebResource(url);

     if (lookUp != null) {
         var tagname = lookUp.items[0].typename;
         var id = lookUp.items[0].id;
         var name = lookUp.items[0].name;
         alert(name + id + tagname);
     }

    }

    any idea???

    Wednesday, April 3, 2013 2:38 PM

Answers

  • Try

    var url = '/_controls/lookup/lookupinfo.aspx?AllowFilterOff=1&DefaultType=1&DefaultViewId=%7bA9AF0AB8-861D-4CFA-92A5-C6281FED7FAB%7d&DisableQuickFind=0&DisableViewPicker=0&LookupStyle=single&ShowNewButton=1&ShowPropButton=1&browse=false';

    //Open Lookup

    var returnParams = openStdDlg(url, document, 550, 550);

    openStdDlg is an internal function that allows to open CRM forms

    HTH

    Sam


    Dynamics CRM MVP | Inogic | http://inogic.blogspot.com| news at inogic dot com

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    • Proposed as answer by Sam - Inogic Thursday, April 4, 2013 4:34 AM
    • Marked as answer by Naveen kumar J Thursday, April 4, 2013 9:00 AM
    Thursday, April 4, 2013 4:34 AM

All replies

  • Could you describe the issue you are experiencing?

    Scott Durow
    Read my blog: www.develop1.net/public     Follow Me on Twitter
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Wednesday, April 3, 2013 6:18 PM
    Answerer
  • Try

    var url = '/_controls/lookup/lookupinfo.aspx?AllowFilterOff=1&DefaultType=1&DefaultViewId=%7bA9AF0AB8-861D-4CFA-92A5-C6281FED7FAB%7d&DisableQuickFind=0&DisableViewPicker=0&LookupStyle=single&ShowNewButton=1&ShowPropButton=1&browse=false';

    //Open Lookup

    var returnParams = openStdDlg(url, document, 550, 550);

    openStdDlg is an internal function that allows to open CRM forms

    HTH

    Sam


    Dynamics CRM MVP | Inogic | http://inogic.blogspot.com| news at inogic dot com

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    • Proposed as answer by Sam - Inogic Thursday, April 4, 2013 4:34 AM
    • Marked as answer by Naveen kumar J Thursday, April 4, 2013 9:00 AM
    Thursday, April 4, 2013 4:34 AM
  • thanks sam....its working:-)
    Thursday, April 4, 2013 9:01 AM