locked
Get view id in RetrieveMultiple RRS feed

  • Question

  • How can I see which view that was used in a plugin for a Retrieve multiple message. I want to handle specific view differently when showing that list.
    Wednesday, October 24, 2012 11:48 AM

Answers

  • Hi,

    I don't think there is a way to get the view id in the plugin. What you can do, is inspect the query that is used for the RetrieveMultiple message, along with its Filters and Conditions.

    If you need to know the view id, I would suggest to create a custom field in the entity. Then in the filters of your views, you can set this field to the view's name or id. In your plugin you would then look for this attribute in the query to find out the view name or id. Then you would remove the attribute from the query, so that valid results are retrieved. From then on, you know the name of the view and you can act upon it as you wish.

    I would personally avoid such an approach though, because it is a little bit complicated and messy.

    Greetings,

    Pavlos


    Please mark this reply as an answer and vote it as helpful if it helps you find a resolution to your problem.
    View my latest gallery contribution here.
    Visit my blog here.

    • Marked as answer by Adamber Wednesday, October 24, 2012 1:13 PM
    Wednesday, October 24, 2012 12:23 PM

All replies

  • Hi,

    I don't think there is a way to get the view id in the plugin. What you can do, is inspect the query that is used for the RetrieveMultiple message, along with its Filters and Conditions.

    If you need to know the view id, I would suggest to create a custom field in the entity. Then in the filters of your views, you can set this field to the view's name or id. In your plugin you would then look for this attribute in the query to find out the view name or id. Then you would remove the attribute from the query, so that valid results are retrieved. From then on, you know the name of the view and you can act upon it as you wish.

    I would personally avoid such an approach though, because it is a little bit complicated and messy.

    Greetings,

    Pavlos


    Please mark this reply as an answer and vote it as helpful if it helps you find a resolution to your problem.
    View my latest gallery contribution here.
    Visit my blog here.

    • Marked as answer by Adamber Wednesday, October 24, 2012 1:13 PM
    Wednesday, October 24, 2012 12:23 PM
  • Thanks

    I solved it by using a unique filter, ie  myfield != "uniquestring", and looking for that in the plugin, It's not neat but for our needs it is sufficient

    Adam

    Wednesday, October 24, 2012 1:13 PM