locked
designing new features in crm forms 2013 RRS feed

  • Question

  • Hi,

    I am new to crm and I have a question.

    How to design a new feature like for example a 'Search' feature in CRM forms 2013 version from scratch?

    If we want to create a custom Search page and a results page are there any form templates that are available already?

    Or else how can I proceed?

    Thanks for any help..

    Monday, August 11, 2014 1:07 PM

Answers

  • Not clear from your description exactly what your intention is.  However if you wish to embed a search button on a native CRM form that interacts with the form's fields this is possible.  You will create the button on your own html page, then embed it in the form as a Web Resource or IFRAME.  You will want to make sure that cross-frame scripting is enabled on this item as you want it to interact with the parent form.  See:

    http://msdn.microsoft.com/en-us/library/gg328034.aspx

    -JayB

    Monday, August 11, 2014 3:16 PM

All replies

  • What you implement will depend in part on what information you are searching for and where it could be found.  In general you will find broad support in CRM for rendering custom pages/code within an IFrame.  I have found it easier to work with HTML5 and JavaScript.  These can be hosted in CRM itself as Web Resources.  If you need to write server-side code such as ASP.NET or Web Services, you will need to host it elsewhere.  A good place to start is with the CRM 2013 SDK.
    Monday, August 11, 2014 1:19 PM
  • Ok..

    In that case, my requirement is to include a search button in a form with all the same fields of a crm form.

    Can I use the existing form template and make changes according to my requirement.

    Because, my search form should like a crm form, I am thinking of using a crm form template itself. Please let me know if this is possible?

    thanks

    Monday, August 11, 2014 3:03 PM
  • Not clear from your description exactly what your intention is.  However if you wish to embed a search button on a native CRM form that interacts with the form's fields this is possible.  You will create the button on your own html page, then embed it in the form as a Web Resource or IFRAME.  You will want to make sure that cross-frame scripting is enabled on this item as you want it to interact with the parent form.  See:

    http://msdn.microsoft.com/en-us/library/gg328034.aspx

    -JayB

    Monday, August 11, 2014 3:16 PM
  • Iam sorry for not being clear..

    But yeah I want to embed a Search button in the ribbon of the main form and also when this button is clicked I want to see a new window of the same main form with all the fields in it for search.

    Can I replicate the same form in any way? Can I use the html and use my own css styles for the Search form?

    Thanks

    Monday, August 11, 2014 5:48 PM
  • Marco Amoedo wrote a post on multi field search back at 2009.

    https://community.dynamics.com/crm/b/crmmarcoamoedoeng/archive/2009/11/24/creating-a-multi-field-search-screen-in-dynamics-crm.aspx

    The post above was coded for CRM 4.0 but the same principles and script apply to CRM 2013.

    You can find more about the FetchViewer script on my blog: http://totbcrm.blogspot.co.il/2014/08/display-custom-fetch-in-grid.html

    Here is a quick example of how to code a FetchXml query and display the results inside and IFRAME.

    Your search button can reload this IFRAME (i.e. call searchAccount()) with new fresh queries depending on fields value.

    function searchAccounts() {
       fAccounts = new FetchViewer("IFRAME_searchaccounts");
       fAccounts.FetchXml  = getFetchQuery();
       fAccounts.LayoutXml = getLayoutXml();
       fAccounts.Entity    = "account";
       fAccounts.QueryId   = "{00000000-0000-0000-00AA-000010001001}";
       fAccounts.RegisterOnTab(0); 
    }
    
    //search on 2 columns
    function getFetchQuery() {
       var nameVal =
    Xrm.Page.getAttribute("name").getValue();
       var phone1Val =
    Xrm.Page.getAttribute("phone1Val").getValue;
       var fetchXml =
         fetch()
           .entity("account")    
             .attributes("name", "telephone1")
                .filter()
                  .condition("name", fetch.op.Equal, nameVal) 
                  .condition("telephone1", fetch.op.Equal, phone1Val);
    
        return fetchXml.toString();
    }
    
    //layout with 2 columns
    function getLayoutXml() {
        return 
            layout(1,"name", "accountid")
               .column("name", 200).column("telephone1", 130)
            .toString();
    }

    The code above also uses a dynamic fetchxml builder library. You can read more about it here

    http://totbcrm.blogspot.co.il/2014/08/building-fetchxml-dynamically.html

    Cheers,

    Adi


    Dev Blog: Dynamics CRM - Thinking outside the Box

    Monday, August 11, 2014 11:06 PM
  • Thanks Adi..

    Looks like the link you gave me is the information I am looking for.

    From where can I download the example and documentation for this?

    Thanks

    Tuesday, August 12, 2014 5:16 PM