locked
How to add a Filter lookup to the html web resource in CRM 2011 RRS feed

  • Question

  • 1. Select accounts and click on ribbon button.

    2. On button click, it should open a html web resource.

    3. Web resource contains a lookup (values should be filtered by the selected accounts related contacts).

    Please suggest how we can get the look up with filtered values in html page.

    Thanks in Advance.

    Tuesday, June 23, 2015 7:38 AM

All replies

  • There may be many scenarios to achieve this, the following is one of them

    Get selected accounts guids from the grid and make them as array then using  bellow fetchxml you can get contacts related to the parent account(use for loop)

    var fetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>" + 
                                   "<entity name='contact'>" + "<attribute name='fullname' />" + 
                                      "<attribute name='contactid' />" + 
                                      "<order attribute='fullname' descending='false' />" + 
                                      "<filter type='and'>" + 
                                          "<condition attribute='parentcustomerid' operator='eq' value='" + accountId + "' />" + 
                                      "</filter>" + 
                                   "</entity>" +
                                "</fetch>";

    Wednesday, June 24, 2015 5:27 AM