locked
Personal views list RRS feed

  • Question

  • Hi there,

    How can we list out all the Personal Views entity wise by using Advanced Find window.

    Where Personal views saved, in UserQuery entity or not.

    Please suggest.

    Thursday, May 29, 2014 8:17 AM

Answers

  • Hi there,

    Finally I found solution, if some one like to use.

                        QueryExpression qa = new QueryExpression("userquery");
                        qa.ColumnSet = new ColumnSet(new string[] { "userqueryid", "name", "returnedtypecode", "fetchxml","statecode" });
                        ConditionExpression ce = new ConditionExpression("returnedtypecode", ConditionOperator.Equal, 4);
                        ConditionExpression ce1 = new ConditionExpression("statecode", ConditionOperator.NotEqual, 0);
                        FilterExpression fl = new FilterExpression(LogicalOperator.And);
                        fl.AddCondition(ce);
                        fl.AddCondition(ce1);
                        qa.Criteria.Filters.Add(fl);
    
                        EntityCollection ec = service.RetrieveMultiple(qa);

    above code give list of all Lead Personal Views list.

    ReturnedTypeCode is parent entity name.

    Name : Name of the Personal View.

    FetchXml : query.

    UserQueryId : unique id for the view.

    • Marked as answer by Kiran Madhav Thursday, May 29, 2014 11:06 AM
    Thursday, May 29, 2014 11:05 AM

All replies

  • Hi,

    Personal views saved in the savedviews. in DB savedquery table.



    Thanks & Regards, MS CRM Consultant, V.Surya. My Blog: http://inventcrm.wordpress.com/


    Thursday, May 29, 2014 8:45 AM
    Answerer
  • Hi Surya,

    Thanks for your quick response.

    Actually I wanted fetch xml for the given screen shot. I want show all Personal Views in 3rd party application (asp.net app).

    Is that achievable, please suggest.

    Thursday, May 29, 2014 9:07 AM
  • Hi,

    yes you can download the fetchxml for the saved views, select the view form the use saved view and download the fetch xml.

    


    Thanks & Regards, MS CRM Consultant, V.Surya. My Blog: http://inventcrm.wordpress.com/

    Thursday, May 29, 2014 9:13 AM
    Answerer
  • Sorry Surya, I think I'm not clear here, Actually I wanted list Personal views.

    Lets say, on lead, account, opportunity entities I've 25,30,35 Personal views respectively. When user selects Account system should show all list of Personal Views for the Account entity in list box.

    Personal Views' fetch xml not saving in SavedViewbase tables.

    Please suggest.

    Thursday, May 29, 2014 9:23 AM
  • Hi there,

    Finally I found solution, if some one like to use.

                        QueryExpression qa = new QueryExpression("userquery");
                        qa.ColumnSet = new ColumnSet(new string[] { "userqueryid", "name", "returnedtypecode", "fetchxml","statecode" });
                        ConditionExpression ce = new ConditionExpression("returnedtypecode", ConditionOperator.Equal, 4);
                        ConditionExpression ce1 = new ConditionExpression("statecode", ConditionOperator.NotEqual, 0);
                        FilterExpression fl = new FilterExpression(LogicalOperator.And);
                        fl.AddCondition(ce);
                        fl.AddCondition(ce1);
                        qa.Criteria.Filters.Add(fl);
    
                        EntityCollection ec = service.RetrieveMultiple(qa);

    above code give list of all Lead Personal Views list.

    ReturnedTypeCode is parent entity name.

    Name : Name of the Personal View.

    FetchXml : query.

    UserQueryId : unique id for the view.

    • Marked as answer by Kiran Madhav Thursday, May 29, 2014 11:06 AM
    Thursday, May 29, 2014 11:05 AM