locked
how to set default user view for a user RRS feed

  • Question

  • Hi ,

    I need to set default user view for a user.

    i have created 3 views v1,v2 and v3 through advance find for account entity, but i click on the account entity through left navigation i want to set view v2 by default.

    Through plugin iam able to set the default views when the views are system views, but these are user views how can i set the default one.

    Please can any one tell me how to proceeed. any suggestions are welcome.

    Thanks,Rajesh.

    Thursday, July 1, 2010 2:58 PM

Answers

  • Hi rajesh, 

    you  can try as david told  u above  with  export/import( i haven't  tried  it so i am not really sure about that).

    Anyway, but regarding  the  above  article from  Andriy, I haven't  tried it but i think u  can  still  register the  above  view  on the "userquery" entity instead of "savedquery" ( i havent' tried it mind you so may be u need to look into  this).

    so try this.

    Build and register assembly. Register new step - Message RetrieveMultiple, Primary entity - userquery, Secondary Entity - none, Stage - Post Stage, Execution Mode = Syncronous, Pipeline - Parent Pipeline.

    in stead of this

    Build and register assembly. Register new step - Message RetrieveMultiple, Primary entity - savedquery, Secondary Entity - none, Stage - Post Stage, Execution Mode = Syncronous, Pipeline - Parent Pipeline.


    Muhammad Ali Khan
    http://malikhan.wordpress.com
    • Marked as answer by Jim Glass Jr Friday, July 2, 2010 5:23 PM
    Friday, July 2, 2010 7:14 AM
  • I doubt you'll be able to get it to work with a userquery, because I'm pretty sure at this point you've proven that CRM just isn't designed that way.  As for the conversion from userquery to savedquery, I suspect it's the only way to establish the view you want without replicating it all by hand (which you probably could have done by now).  So, unless somebody else comes up with a converter utility (which would, honestly, be really cool), you may be the one to make it.
    Dave Berry
    • Marked as answer by Jim Glass Jr Friday, July 2, 2010 5:23 PM
    Friday, July 2, 2010 3:41 PM
    Moderator

All replies

  • Thanx for the reply,

    I have referred to the above links what they are saying about the system views but not user views. Can any one tell me how to do that.

    Any susggestions are welcome

    Friday, July 2, 2010 5:05 AM
  • I think you need to convert the user view into a system view.  Each is based on a savedquery entry, if I recall correctly.  If you can export a user view and change it's type and import it back to CRM as a system view, you should be able to accomplish what you need.  I would guess that this could be accomplished either in the Customization.xml directly, or some intermediary piece of stand-alone code that is designed for this purpose using the Web Services.
    Dave Berry
    Friday, July 2, 2010 5:11 AM
    Moderator
  • can you tell me how to convert a user view to system view. after exporting which type should be changed.
    Friday, July 2, 2010 6:00 AM
  • can you tell me what type should i change in the database.
    Friday, July 2, 2010 6:13 AM
  • Hi rajesh, 

    you  can try as david told  u above  with  export/import( i haven't  tried  it so i am not really sure about that).

    Anyway, but regarding  the  above  article from  Andriy, I haven't  tried it but i think u  can  still  register the  above  view  on the "userquery" entity instead of "savedquery" ( i havent' tried it mind you so may be u need to look into  this).

    so try this.

    Build and register assembly. Register new step - Message RetrieveMultiple, Primary entity - userquery, Secondary Entity - none, Stage - Post Stage, Execution Mode = Syncronous, Pipeline - Parent Pipeline.

    in stead of this

    Build and register assembly. Register new step - Message RetrieveMultiple, Primary entity - savedquery, Secondary Entity - none, Stage - Post Stage, Execution Mode = Syncronous, Pipeline - Parent Pipeline.


    Muhammad Ali Khan
    http://malikhan.wordpress.com
    • Marked as answer by Jim Glass Jr Friday, July 2, 2010 5:23 PM
    Friday, July 2, 2010 7:14 AM
  • I registering the userquery instead of savedquery  i primary entity. After registering when ever i click on the account the plugin is not firing.
    Friday, July 2, 2010 11:12 AM
  • you need to  change  this line  in plugin as well.  Also try to debug  the plugin and make sure the problem is not with plugin  firing,  the  problem could be  becaue  the code was writtien for savedquery.

    if (context.PrimaryEntityName == EntityName.savedquery.ToString() &&
                    context.InputParameters.Contains("Query") &&
                    context.InputParameters["Query"] is QueryExpression)
                {

    to

    if (context.PrimaryEntityName == EntityName.userquery.ToString() &&
                    context.InputParameters.Contains("Query") &&
                    context.InputParameters["Query"] is QueryExpression)
                {


    Muhammad Ali Khan
    http://malikhan.wordpress.com
    Friday, July 2, 2010 11:37 AM
  • Hi,

    Thanx for the reply, i kept the above code in plugin and now the plugin is firing, but iam not able to set the default one. While with saved queries iam able to set the the view to default one by using "isdefault" column in saved query. but in userquery that column is not there, how can i do that?

    Please give me any suggestions.

    Thanks,Rajesh.

    Friday, July 2, 2010 2:05 PM
  • I doubt you'll be able to get it to work with a userquery, because I'm pretty sure at this point you've proven that CRM just isn't designed that way.  As for the conversion from userquery to savedquery, I suspect it's the only way to establish the view you want without replicating it all by hand (which you probably could have done by now).  So, unless somebody else comes up with a converter utility (which would, honestly, be really cool), you may be the one to make it.
    Dave Berry
    • Marked as answer by Jim Glass Jr Friday, July 2, 2010 5:23 PM
    Friday, July 2, 2010 3:41 PM
    Moderator
  • I suspect that Andriy's code can be modified to instead use userquery, but both the Plugin and Javascript will likely have to change.

    Dave Berry
    Friday, July 2, 2010 5:12 PM
    Moderator
  • Iam able to do every thing what i want, but the only way i was at  is setting the default view for user defined views.

    Cany any one tell me how to set default view for user defined views

    Saturday, July 3, 2010 4:48 AM