Forums

Forums / General Discussions / Uisng a parameter passed in a url in a List View query

Uisng a parameter passed in a url in a List View query

7 posts, 1 answered
  1. Graham Lee
    Graham Lee avatar
    6 posts
    Registered:
    09 Aug 2024
    09 Aug 2024
    Link to this post
    Hi,

    I'm trying to pass a parameter in the URL from a button coded in a Sub List View using the following HTML

    <a class='btn btn-primary' href='event-landing-page?msevtmgt_eventid=#:msevtmgt_eventid#' style='margin-bottom: 0.2rem;'><span class="fa fa-arrow-right"></span> <strong>Register Now !</strong></a>
    The id seems to pass in the URL although it is different form the actual id (I think its encrypted)

    I want to pass the id in the URL to a data query in a List View on the page, I used the following fetchxml filter in the query

    <filter type="and">
    <condition attribute="msevtmgt_eventid" operator="eq" value="@P1@" />
    </filter>
    I have also tried 

    <filter type="and">
    <condition attribute="msevtmgt_eventid" operator="eq" value="@P1:encrypted@" />
    </filter>

    I get a no data on the List View when it renders. Is this the correct approach, is there another way that this can work?

    Best regards,
    Graham







  2. Dustyn Holland
    Dustyn Holland avatar
    3 posts
    Registered:
    12 Aug 2024
    13 Aug 2024 in reply to Graham Lee
    Link to this post
    Hello Graham,

    Can you please explain the context and/or use case you are attempting to create here?

    What is the purpose of the form you are trying to create?

    Sorry, we just need some more context on what is happening.

    Thank you,

    Dustyn Holland
  3. Graham Lee
    Graham Lee avatar
    6 posts
    Registered:
    09 Aug 2024
    13 Aug 2024 in reply to Dustyn Holland
    Link to this post
    Hi Dustin,

    Thanks for the response. The use case is that I have a list of events presented in a sublist view. There is a button on the sublist view. that directs to a landing page for the event. The URL in the sublist view page passes the event id to the landing page. The landing page has a list view that I want filtered to the event id. I will build the landing page using the HTML in the list view. If there is a better approach I would be willing to use it. I hope this clarifies, if there is anything else let me know!
  4. Dustyn Holland
    Dustyn Holland avatar
    3 posts
    Registered:
    12 Aug 2024
    15 Aug 2024 in reply to Graham Lee
    Link to this post
    Hello Graham,

    How is the relationship currently built between the Event entity and the related entity you want to have listed on the Event landing page in CRM?

    For instance, if they were to select an Event from a grid, the link directs to them to that specific Event's landing. On that page you want to have another grid that reflects records related to that Event, is that correct? If that is the case then you can manage that through the relationship and query strings in the URL. 

    What is the entity that you want to have listed on any given Event's landing page?

    Dustyn
  5. Graham Lee
    Graham Lee avatar
    6 posts
    Registered:
    09 Aug 2024
    15 Aug 2024 in reply to Dustyn Holland
    Link to this post
    Hi Dustyn,

    I just want to filter a list view with an id passed through the URL. The reason I want to do this is because the list view is the only widget I can see that gives me the option to edit the HTML. I want to use this to build a landing page for the event. The event id will be passed in the URL from the previous page in to the list view. I want to filter the list view thorugh the fetchxml query for that one ID.
  6. Graham Lee
    Graham Lee avatar
    6 posts
    Registered:
    09 Aug 2024
    15 Aug 2024 in reply to Dustyn Holland
    Link to this post
    Just to answer this 

    "For instance, if they were to select an Event from a grid, the link directs to them to that specific Event's landing. On that page you want to have another grid that reflects records related to that Event, is that correct? If that is the case then you can manage that through the relationship and query strings in the URL. "

    When I select an Event from the grid, the link directs to that specific landing page where I display data from that specific event. I don't want data from any related entities. Just that event if there is another widget that allows me to edit the HTML that is that a list I would not need to filter by the ID but I can't seem to find one. I'm relatively new to this and not a full time dev so may be I'm missing something.

    Thanks for your patience!

  7. Graham Lee
    Graham Lee avatar
    6 posts
    Registered:
    09 Aug 2024
    Answered
    16 Aug 2024 in reply to Dustyn Holland
    Link to this post
    Hi Dustyn,

    I see what the problem is now, I wasn't setting the filter variable in the widget. Thanks for you help!
7 posts, 1 answered