none
Advanced find view in iframe

    Question

  • hi,

    I have created a advanced find view that displays the active records. I want to display the result of the advanced find view inside the iframe of opportunity entity. when i try to open the advanced find view in browser with this URL(/advancedfind/fetchdata.aspx?entitycode=3&queryid={00000000-0000-0000-0000-000000000000}&viewtype=1039) i am getting an error message. Is there a way to display the advanced find view inside the iframe.

     

    Can anyone give me some tips in doing this.

     

    thanks

    Chris.

    Tuesday, March 18, 2008 11:14 AM

Answers

  • Hi.

     

    The EntityCode object variable should be defined at the top of you aspx runat server script e.g.

     

    <script runat="server">

     

    string FetchXml     = string.Empty;

    string LayoutXml    = string.Empty;

    string EntityName   = string.Empty;

    string SortCol      = string.Empty;

    string SortDescend  = string.Empty;

    string EntityCode   = string.Empty;

    string QueryId      = string.Empty;

    string ViewType     = string.Empty;

     

    Make sure all the aspx code elements mentioned above exist.

     

    The ORG_UNIQUE_NAME is a global variable that is exposed by Microsoft and holds the current organization name.

     

    Cheers,

    Adi 

     

    Monday, March 24, 2008 12:51 PM

All replies

  • Is it possible to display the result of a advanced find view in iframe. i have saved a advanced find view that displays the active records. i want to display the result of that advanced find view inside an iframe in opportunity entity. can anyone help in doing this task...

     

    thanks

    Chris

     

    Wednesday, March 19, 2008 5:38 AM
  • Hi.

     

    If the advanced find view fetch does not need to be modified by you then you need to target the AdvFind.aspx page and not the fetchdata.aspx. You can set the AutoRun QS Parameter to True and the advanced find will run immediately.

     

    In most cases you need to concatenate the current opportunity or account id into the fetchxml to reflect the desirable result set. In that case you need to implement a custom page with an iframe and a small form that mimic the advanced find functionality.

     

    This is also the reason why your example above does not work, its missing this vital component.

     

    Cheers,

    Adi

     

     

    Wednesday, March 19, 2008 6:30 AM
  • Adi,

     Is there any sample code available for doing this task. shoudl i have to pass the auto run parameter to the url of the advanced find view.

    i have created a 1:n realtioship between the custom entity and opportunity entity. i want to display the active records of the custom entity inside the iframe in opportunity entity. Can you please guide me in doing this.

     

     thanks

     Chris

     

    Wednesday, March 19, 2008 7:06 AM
  • Hi.

     

    In that case you need to use the second option. You have to create your own advanced find page and set the

    Fetchxml, layoutxml and the reset of the relevant fields in order for this to work.

     

    I'll be back later on and walk you through this task.

     

    Cheers,

    Adi

     

    Wednesday, March 19, 2008 7:29 AM
  • Hi ,

      Do i have to create a custom aspx page with the fetchxml query similar to the one in the advanced find view which i created in opportunity entity.

     

    thanks

    Chris

    Wednesday, March 19, 2008 10:52 AM
  • Hi Chris.

     

    This one is for the community.

     

    This is a complete advanced find solution. It’s a single aspx witch acts as a center stage for all fetchxmls you wish to present in an iframe.

    All you need to do is identify each fetchxml / crmgrid with a fetchid and set the relevant fields inside the CustomAdvFind.aspx

     

    Notes:

    1. When you create an iframe in the customization Remember to uncheck the display iframe border. The crmGrid already has a border.

    2. If you are using the professional edition < Single Organization > you can set the iframe URL directly from the customization.

        /[Organization Name]/ISV/CrmExtentions/CustomAdvFind.aspx?fetchid=1

        Otherwise you'll need to use the form onload event to set the organization name for example:

       

        function OnCrmPageLaod()

        {
              var advFindIframe = document.all.IFRAME_test;

                   advFindIframe.src = "/" + ORG_UNIQUE_NAME + "/ISV/CrmExtentions/CustomAdvFind.aspx?fetchid=1"
        }

     

        OnCrmPageLaod();

     

    * CrmExtentions – is the name of my VD. Change the name to reflect your application name.

     

    Wednesday, March 19, 2008 11:36 AM
  • Create the CustomAdvFind.aspx and paste the following code into it.

     

     

    <html xmlns="http://www.w3.org/1999/xhtml" >

    <head runat="server">

     

    <script runat="server">

     

    string FetchXml     = string.Empty;

    string LayoutXml    = string.Empty;

    string EntityName   = string.Empty;

    string SortCol      = string.Empty;

    string SortDescend  = string.Empty;

    string EntityCode   = string.Empty;

    string QueryId      = string.Empty;

    string ViewType     = string.Empty;

         

    private void Page_Load( object sender , EventArgs e )

    {

          switch( Request["fetchid"] )

          {

                //Usage Example

                case "1":

                      FetchXml = @"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>

                                        <entity name='activitypointer'>

                                              <attribute name='subject'/>

                                              <attribute name='activityid'/>

                                              <attribute name='scheduledstart'/>

                                              <attribute name='regardingobjectid'/>

                                              <attribute name='prioritycode'/>

                                              <attribute name='scheduledend'/>

                                              <attribute name='activitytypecode'/>

                                              <order attribute='scheduledend' descending='false'/>

                                              <filter type='and'>

                                                    <condition attribute='statecode' operator='in'>

                                                          <value>0</value>

                                                          <value>3</value>

                                                    </condition>

                                                    <condition attribute='activitytypecode' operator='ne' value='4406'/>

                                              </filter>

                                              <link-entity name='activityparty' from='activityid' to='activityid' alias='aa'>

                                                    <filter type='and'>

                                                          <condition attribute='partyid' operator='eq-userid'/>

                                                    </filter>

                                              </link-entity>

                                        </entity>

                                  </fetch>";

                      LayoutXml = @"<grid name='resultset' object='4200' jump='subject' select='1' icon='1' preview='1'>

                                              <row name='result' id='activityid' multiobjectidfield='activitytypecode'>

                                                    <cell name='activitytypecode' width='100' />

                                                    <cell name='subject' width='300' />

                                                    <cell name='regardingobjectid' width='100' />

                                                    <cell name='prioritycode' width='100' />

                                                    <cell name='scheduledstart' width='140' />

                                                    <cell name='scheduledend' width='140' />

                                              </row>

                                          </grid>";

                      EntityName  = "activity";

                      EntityCode  = "4200";

                      QueryId     = "{00000000-0000-0000-00AA-000010001899}";

                      ViewType    = "1039";

                      SortCol     = "scheduledstart";

                      SortDescend = "true";

                      break;

          }

    }

    </script>

     

    Wednesday, March 19, 2008 11:37 AM
  • <script language="javascript">

    function OnCustomGridReady()

    {

          if( document.all.resultFrame.readyState != 'complete' )

                return;

     

          resultFrame.document.body.style.padding = "0px";

    }

    </script>

     

    </head>

    <body topmargin="0" leftmargin="0" scroll="no" onload="resultRender.submit();">

     

    <FORM id="resultRender"

                action="/AdvancedFind/fetchData.aspx?EntityCode=<%=EntityCode%>&QueryId=<%=QueryId%>&ViewType=<%=ViewType%>"

                method="post"

                target="resultFrame">

               

          <INPUT type="hidden" name="FetchXml"      value="<%=FetchXml%>">

          <INPUT type="hidden" name="LayoutXml"     value="<%=LayoutXml%>">

          <INPUT type="hidden" name="EntityName"    value="<%=EntityName%>">

          <INPUT type="hidden" name="DefaultAdvFindViewId" value="<%=QueryId%>">

          <INPUT type="hidden" name="ViewId"        value="<%=QueryId%>">

          <INPUT type="hidden" name="ViewType"      value="<%=ViewType%>">

          <INPUT type="hidden" name="SortCol"       value="<%=SortCol%>">

          <INPUT type="hidden" name="SortDescend"   value="<%=SortDescend%>">

         

    </FORM>

     

    <iframe id="resultFrame"

                name="resultFrame"

                src="/[ORG_UNIQUE_NAME]/_root/Blank.aspx"

                onreadystatechange="OnCustomGridReady();"

                width="100%"

                height="100%"

                scrolling="no"></iframe>

    </body>

    </html>

     

    Cheers,

    Adi

    Wednesday, March 19, 2008 11:38 AM
  • hi adi,

      i have created a custom aspx page with the code mentioned above. i am having a some queries regarding the org_unique_name, grid name. from which location i can get the org_unique_name and the gridname.

     

     i used c:/inetpub/crm/_root/blank.aspx in the src attribute of iframe and "crm/AdvancedFind/fetchData.aspx?EntityCode

    =<%=EntityCode%>&QueryId=<%=QueryId%>&ViewType=<%=ViewType%>" in the action attribute of the Form tag. when i execute my custom aspx page i am getting a compilation error message in the forms action tag. Can you please provide me some tip.

     

    thanks

    Chris

     

     

     

    Monday, March 24, 2008 10:33 AM
  •  

    Hi.

     

    The blank.aspx does not return any html to the client so instead you can use "about:blank".

     

    <iframe id="resultFrame"

                name="resultFrame"

                src="about:blank"

                onreadystatechange="OnCustomGridReady();"

                width="100%"

                height="100%"

                scrolling="no"></iframe>

     

     

    In order to support multi-tenancy you can pass the organization name as a Query String Parameter e.g.

     

    Put the following code in the onload event:

     

    function OnCrmPageLoad()

    {

           var IFRAME_CustomGrid = document.all.IFRAME_CustomGrid;

                IFRAME_CustomGrid.src = "/" + ORG_UNIQUE_NAME + "/ISV/CrmExtentions/CustomAdvFind.aspx?fetchid=1&orgname=" + ORG_UNIQUE_NAME

    }

     

    OnCrmPageLoad();

     

    Now, you can set the above iframe src e.g.

     

    <iframe id="resultFrame"

                name="resultFrame"

                src="/<%=Request["orgname"]%>/_root/blank.aspx"

                onreadystatechange="OnCustomGridReady();"

                width="100%"

                height="100%"

                scrolling="no"></iframe>

     

    The form action value sould stay as is.

     

    Cheers,

    Adi

     

     

    Monday, March 24, 2008 11:20 AM
  • hi,

     Is Org_Unique_Name is the business unit of CRM or can i pass any string variable in the query string orgname. i am getting an error in the following line when i run the visual studio application.

      <FORM id=resultRender
    action="/AdvancedFind/fetchData.aspx?EntityCode=<%=EntityCode%>&amp;QueryId=<%=QueryId%>&amp;ViewType=<%=ViewType%>" method=post target=resultFrame>

    error message : 'SampleFetchxml.WebForm1.EntityCode' is inaccessible due to its protection level

     

    thanks

    Chris

     

    Monday, March 24, 2008 12:36 PM
  • Hi.

     

    The EntityCode object variable should be defined at the top of you aspx runat server script e.g.

     

    <script runat="server">

     

    string FetchXml     = string.Empty;

    string LayoutXml    = string.Empty;

    string EntityName   = string.Empty;

    string SortCol      = string.Empty;

    string SortDescend  = string.Empty;

    string EntityCode   = string.Empty;

    string QueryId      = string.Empty;

    string ViewType     = string.Empty;

     

    Make sure all the aspx code elements mentioned above exist.

     

    The ORG_UNIQUE_NAME is a global variable that is exposed by Microsoft and holds the current organization name.

     

    Cheers,

    Adi 

     

    Monday, March 24, 2008 12:51 PM
  • hi adi,

      sorry for the late reply from my side. i followed all the steps as per the instructions. when i included the aspx page inside the iframe and tested using the preview window i am getting a CRM server error.

     i have used the following code in the onload event of the account entity.

          function OnCrmPageLaod()

        {
              var advFindIframe = document.all.IFRAME_Test;

                   advFindIframe.src = "http://localhost/Sample/CustomAdvFind.aspx?fetchid=1"
        }

         OnCrmPageLaod();

     

    i am getting a ORG_UNIQUE_NAME is undefined error message in the form onload event on using the following code.

     

    function OnCrmPageLoad()

    {

           var IFRAME_CustomGrid = document.all.IFRAME_CustomGrid;

                IFRAME_CustomGrid.src = "/" + ORG_UNIQUE_NAME + "/ISV/Sample/CustomAdvFind.aspx?fetchid=1&orgname=" + ORG_UNIQUE_NAME

    }

     

    OnCrmPageLoad();

     

     Can you pls help me in resolving this issue.

    Thursday, March 27, 2008 6:19 AM
  • Hi.

     

    The code above should be run the entity form onload event.

    The ORG_UNIQUE_NAME should be available to you.

     

    Adi

     

     

    Thursday, March 27, 2008 9:07 AM
  • hi adi,

    I used the code in the account form's onload event. it is throwing an error message "ORG_UNIQUE_NAME' is undefined.

    Also when i try to run the CustomAdvFind.aspx page in the browser using http://localhost/sample/customadvfind.aspx. i  am getting ' An error has occurred. please contact your system administrator' pop up message. On clicking the try agin button in the pop up window, i am getting a script error 'Access is denied' .

     

    Thanks for the quick reply.

     

    thanks

    Chris

    Thursday, March 27, 2008 9:20 AM
  • hi adi,

      should i have to put the aspx application inside the root folder of CRM and create a virtual directory inside the CRM application site in IIS.

      if i use the following line of code in <form> tag i am able to get the main screen of the Advanced find view with 'Access Denied' script error.

         <FORM id="resultRender"
    action="http://localhost:5555/AdvancedFind/AdvFind.aspx?EntityCode=<%=EntityCode%>&QueryId=<%=QueryId%>&ViewType=<%=ViewType%>"
    method="post" target="resultFrame">

    whereas if i am using the following code

     <FORM id="resultRender"
    action="http://CRM:5555/AdvancedFind/fetchData.aspx?EntityCode=<%=EntityCode%>&QueryId=<%=QueryId%>&ViewType=<%=ViewType%>"
    method="post"
    target="resultFrame">. i am getting CRM error.

     

    Can you pls tell me what is wrong in my approach.

     

    Thanks

    Chris

     

     

     

     

    Friday, March 28, 2008 6:12 AM
  • Copy the file into the ISV folder. Change the directive so no code behind is needed. I put the entire code inside the aspx so deployment would be easy.

    Replace the server side fetchxml , layoutxml and the rest of the variables with your values.

     

    If you copied the code as is this should work immediately.

     

    Adi

     

    Sunday, March 30, 2008 4:58 AM
  • hi adi,

     Now i am able to run the customadvfind.aspx page in the browser. when i include the URL(http://localhost/sample/customadvfind.aspx?fetchid=1)  of the custom advanced find page as the source of IFRAME in CRM, its displaying a blank page.

     I am using CRM 3.0. Can you pls tell me how can i bring the custom aspx page inside the iframe in crm.

     

     

    Thanks

    Chris.

     

     

    Monday, March 31, 2008 6:55 AM
  • Hi.

     

    This is example was written for Titan not v3.0.

    Open a new thread "Advanced find view in iframe v3.0" and I'll post a full example later on.

     

    Adi

     

    Monday, March 31, 2008 7:01 AM
  • Hi Adi,

     

    I tried the advanced find view code above and it works great for system view ie. My Active Contacts, etc. But I am getting Record Is Unavailable error message when I use it on User Saved View. I created couples of user saved view, some with and without conditions, and all fail. Any idea?

     

    Thanks.

     

    - Henri
    Friday, April 11, 2008 1:16 AM

  • Is there a way to get the loading gif to show while waiting for the fetch to load in the iframe?
    -Stian- 
    Friday, November 21, 2008 9:56 AM
  • Take a look at the following post. The solution also takes care of the loading gif.

     

    Friday, November 21, 2008 12:23 PM
  • Hi , thanks for this nice code. It works well for me.

     

    But I have one small issue with calling this aspx page from form nav bar instead of forms iframe.

     

    In such case I get Advandce View with just three lines.

     

    Any idea how to set iframe to use all available space like History or Activities navigation within form.

     

    Thanks for help

    Wednesday, December 03, 2008 9:55 PM
  • hi

    i saw this solution and it's vary good

    but i have one implementation problem 

    if im using the url:

        /[Organization Name]/ISV/CrmExtentions/CustomAdvFind.aspx?fetchid=1

    in the customization it's not working

     

    if i copy this url to the explorer a new page open the the result displaied on the new page , this is probably the resion

    it's not working from the iframe customization

     

    hope for a solution

     

    Tuesday, December 30, 2008 3:39 PM
  • Hi,

     

    You should set the IFRAME customization URL to “about:blank” and instead add the following script in the onload event.

     

    document.all.[ IFRAME ID ].src = prependOrgName( “/ISV/CrmExtentions/CustomAdvFind.aspx?fetchid=1” );

     

    The script appends the current organization name e.g. “/” + ORG_UNIQUE_NAME to the specified URL and sets the IFRAME src attribute.

     

    Adi

     

     

    Tuesday, December 30, 2008 5:38 PM
  • Dear Adi,

     

    I have a similar question with iFrames. I hav an entity with a pickilst with options A, B and C. I have also created an iFrame inside the form. Now my quest is I hav to write a Jscript code on the onload event where the moment i select option B from the pick list the iFrame should get disabled or read only after I save the record.  For options A and C it should work normally only as the iFrame gets activated but the moment I choose B it shld get disabled.

    Followin is the code for disabling a field after this I dont know how to proceed. Pls help

    // set it as readonly
    crmForm.all.new_textfield.readOnly = true;
    // OR set it as disabled
    crmForm.all.new_textfield.disabled = true;
     
    Thanx a lot in advance.
    Best
    Prince
    Monday, January 05, 2009 9:11 PM
  • Hi Prince,

     

    You should add a condition to the onload event that checks the picklist value. If it is set to B then disable the iframe.


    The instruction in the following link will show you how to disable the iframe http://mscrm4ever.blogspot.com/2008/11/restricting-access-to-iframe-read-only.html

     

    Adi

    Tuesday, January 06, 2009 12:39 AM
  • Hi,

     

    I've made an custom asp page based on an advanced find as described in this thread. I'm using it to show opportunities in an iframe on the Account form.

     

    Is it possible to make this asp map the account name in to the account field in opportunity when you click New and create a new opportunity record on the customized asp page? I wan't this to work the same was as when you choose new record from the navbar opportunity.

    Wednesday, January 07, 2009 2:05 PM
  • You might try overriding the window.open function from the parent window, verify that that the new button was clicked by checking whether the opening page is missing the id (GUID) QueryString parameter and add the addressable form lookup information to the QueryString.  I can’t think of another way of doing this.

     

    Adi

     

    Thursday, January 08, 2009 6:21 AM
  • Hi,

    Does anyone have any code example of how to override the new button click in advanced view find by using window.open function so that lookup column is automatically populated. I was able to use advanced view approach from this posting as customized page but the new button never populates the lookup attribute.

    Thanks.
    Thursday, May 07, 2009 7:31 PM
  • The following post uses another approach which handles the creation of a new record in the context of a parent form. You can either implement this solution instead of the one offered in this post or mimic the functionality. I believe you’ll find it much easier to implement the FetchViewer as described at my blog. Good luck.
    Blog: http://mscrm4ever.blogspot.com/ * Website: http://gicrm.upsite.co.il/
    Friday, May 08, 2009 11:51 AM
  • Hi Adi,

    Thanks for the solution.

    I'm trying to implement your initial solution inside a custom entity with an IFRAME where I set the URL of the IFRAME to /ISV/XYZ/CustFind.aspx?fetchid=1.
    The following code gives me the "Object Expected" error when I try to run the page from within my entity's form IFRAME:

    <body topmargin="0" leftmargin="0" scroll="no" onload="resultRender.submit()">
    <form id="resultRender"
                action="/AdvancedFind/fetchData.aspx?EntityCode=<%=EntityCode%>&QueryId=<%=QueryId%>&ViewType=<%=ViewType%>" 
                method="post" 
                target="resultFrame">
    
          <input type="hidden" name="FetchXml"      value="<%=FetchXml%>" >
          <input type="hidden" name="LayoutXml"     value="<%=LayoutXml%>">
          <input type="hidden" name="EntityName"    value="<%=EntityName%>">
          <input type="hidden" name="DefaultAdvFindViewId" value="<%=QueryId%>">
          <input type="hidden" name="ViewId"        value="<%=QueryId%>">
          <input type="hidden" name="ViewType"      value="<%=ViewType%>">
          <input type="hidden" name="SortCol"       value="<%=SortCol%>">
          <input type="hidden" name="SortDescend"   value="<%=SortDescend%>">
    </form>


    It seems to me that the page never gets to the scipts inside my head tags either?

    Any ideas for me perhaps?

    Thanks.

    R
    Friday, June 05, 2009 1:18 PM
  • Hi Adi,

    I'm getting a different error when the page loads.

    Can you help me?

    The error is:

    InvalidOperationException: CRM Parameter Filter - Invalid parameter '=EntityCode=1084&QueryId={008FBB15-98E9-4C5D-A81A-E685FF8CCC2C}&ViewType=1039&AutoRun=True' in Request.QueryString on page /Entity/AdvancedFind/fetchData.aspx
    The raw request was 'POST /Entity/AdvancedFind/fetchData.aspx?EntityCode%3d1084%26QueryId%3d%7b008FBB15-98E9-4C5D-A81A-E685FF8CCC2C%7d%26ViewType%3d1039%26AutoRun%3dTrue' called from http://10.12.10.40:5555/ISV/Processor/CustomAdvFind.aspx.]
       at Microsoft.Crm.Application.ParameterFilter.ValidateParameter(Page page, ArrayList parameterCollection, String key, String value, String collectionName, EntityType pageEntityType)
       at Microsoft.Crm.Application.ParameterFilter.ValidateParameters(Page page, EntityType pageEntityType, Boolean alwaysEnableParameterChecking)
       at Microsoft.Crm.Application.ParameterFilter.ValidateParameters(Page page, EntityType pageEntityType)
       at Microsoft.Crm.Application.Controls.AppPage.ValidatePageParameters()
       at Microsoft.Crm.Application.Controls.AppPage.OnInit(EventArgs e)
       at System.Web.UI.Control.InitRecursive(Control namingContainer)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint
    Thursday, December 10, 2009 6:21 PM
  • Ensure that the URL query string parameters contain valid parameter names. CRM throws an error when you use misspelled or custom query string parameter names.


    GI CRM Blog * GI Website
    Saturday, December 19, 2009 9:14 PM
  • Hi,

    I am using advanced find view in an iframe.

    My code is similar to the above code.But when i execute this code, it gives me 404 Page not found error. If i use this custom page in iframe it gives me "Record is Unavailable" Error.

    Can u please tell me why im getting this error.

     

     

     

     

    Friday, March 26, 2010 2:19 PM
  • Hi Adi,

    This solution worked great when I am using a CRM entity, but when I created an advanced find view containing one of our custom entities I got an error "To use this saved view, you must remove criteria and columns that refer to deleted or non-searchable items." The CRM trace shows the folowing

    [2010-05-12 18:13:11.6] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread:    1 |Category: Exception |User: 00000000-0000-0000-0000-000000000000 |Level: Error | CrmException..ctor
     at CrmException..ctor(Int32 errorCode, Object[] arguments)
     at GridUtility.GetColumnInfo(XmlNode node, EntityMetadata entityMeta, Boolean hasRelatedEntityColumns, String relatedEntityColDisplayNameMask, Int32 langCode)
     at AppGrid.SetGridColumns(String layoutXml, String fetchXml, EntityMetadata entityMeta)
     at FetchData.SetGridColumns(String layoutXml, String fetchXml)
     at FetchData.ConfigurePage()
     at AppUIPage.OnPreRender(EventArgs e)
     at Control.PreRenderRecursiveInternal()
     at Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
     at Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
     at Page.ProcessRequest()
     at Page.ProcessRequestWithNoAssert(HttpContext context)
     at Page.ProcessRequest(HttpContext context)
     at advancedfind_fetchdata_aspx.ProcessRequest(HttpContext context)
     at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
     at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
     at ApplicationStepManager.ResumeSteps(Exception error)
     at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
     at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
     at HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
     at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
    >Crm Exception: Message: Server was unable to process request., ErrorCode: -2140991216
    [2010-05-12 18:13:11.6] Process: w3wp |Organization:02b4dee4-bbad-4501-8851-3a1965a2ad2a |Thread:    1 |Category: Application |User: 00000000-0000-0000-0000-000000000000 |Level: Error | ErrorInformation.LogError
    >MSCRM Error Report:
    --------------------------------------------------------------------------------------------------------
    Error: Exception of type 'System.Web.HttpUnhandledException' was thrown.

    Error Number: 0x80631110

    Error Message: Server was unable to process request.

    Error Details: Server was unable to process request.

    Source File: Not available

    Line Number: Not available

    Stack Trace Info: [CrmException: Server was unable to process request.]
       at Microsoft.Crm.Application.Controls.GridUtility.GetColumnInfo(XmlNode node, EntityMetadata entityMeta, Boolean hasRelatedEntityColumns, String relatedEntityColDisplayNameMask, Int32 langCode)
       at Microsoft.Crm.Application.Controls.AppGrid.SetGridColumns(String layoutXml, String fetchXml, EntityMetadata entityMeta)
       at Microsoft.Crm.Web.AdvancedFind.FetchData.SetGridColumns(String layoutXml, String fetchXml)
       at Microsoft.Crm.Web.AdvancedFind.FetchData.ConfigurePage()
       at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e)
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    [HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown.]
       at System.Web.UI.Page.HandleError(Exception e)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
       at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
       at System.Web.UI.Page.ProcessRequest()
       at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
       at System.Web.UI.Page.ProcessRequest(HttpContext context)
       at ASP.advancedfind_fetchdata_aspx.ProcessRequest(HttpContext context)
       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

    I think this is the code in the GetColumnInfo method that throws the error but I can't figure out why.

    AttributeMetadata metadata4 = entityMeta.TryGetAttribute(str5);

     

    if (metadata4 == null)

    {

     

    throw new CrmException(-2140991216, new object[0]);

    }

    Any help will be apreciated.

    Thanks

    Lyudmil

     

     

    Wednesday, May 12, 2010 3:20 PM
  • This line is confusing to me

    <condition attribute='partyid' operator='eq-userid'/>

    how would i set this to the current record?

    Is there anyway to see the fetchxml of an existing advanced find for reference?


    David Withers
    Thursday, June 16, 2011 7:27 PM
  • Hello Adi,

    I have succeeded to display the result of an advanced find in an IFrame. Thank you for your codes.

    While now I met a problem:

    I need to display the result of an advanced find on Task. If I use the FetchXml directly on the entity Task, the result says I should remove the fields that are not searchable. So I retry to do the advanced find on Activity. The problem is that I have some custom fields in task and I can not get them displayed on the result view in LayoutXML. I can only show the fields in Activity (activitypointer). As we can get a link in FetchXML to define the criteria, can't we establish a link in LayoutXML? 

    Do you have an idea on this point? 

    Thank you in advance.

    Chao

    Friday, December 16, 2011 10:27 AM