Using FetchXml in Power Pages

Поділитися
Вставка
  • Опубліковано 15 жов 2024
  • This time, we will be using FetchXml and Liquid to make a custom List of the Products. It will enable more flexibility in how we display the Products in our Dataverse Instance. The solution can even show a header image of the product.

КОМЕНТАРІ • 4

  • @lissy9113
    @lissy9113 5 днів тому

    How do you access the details form to edit the list entries?

    • @EverythingAroundDataverse
      @EverythingAroundDataverse  2 дні тому

      Not sure yet whether the question aims at standard lists as shown in the beginning of the video or at custom lists like they are built throughout the video.
      Standard List:
      In the Design Studio, hover over the list, click the Edit List button and in the Actions Tab of the dialog you will find the list actions like "Create a new Record" as well as row actions like "View details" or "Edit record". From here you can select the form that shall be shown.
      Custom List:
      Here I would start by defining a subpage containing the form where when I choose "Edit Form" in the design studio, in the Data Tab of the dialog I set it to "Is read-only" or "updates an existing record".
      By default the source guid for the form being shown on this page is takes from a query parameter "id", however this may be changed in the Power Pages Management app.
      And next I would define a button in my custom list. I know the guid of the record from my fetchXml query and the button will simply navigate to the subpage with the form I defined earlier. So assuming the list page is called /products and the form subpage is /details, the button would navigate to /products/details?id={{product.productid}}
      productid is the guid here, something like 00000000-0000-0000-0000-000000000000.
      Hope this helps!

  • @Hasuna9
    @Hasuna9 7 місяців тому

    One question.
    So i have a customer that can log into the account and view his Delivery Company, which works fine. However when i go into the details page, the delivery company has different drivers associated with that company. So on the details page i have a list that should show the driver for that company, but unfortunately it also shows the drivers for other companys, but still associated with the customer only. How do i fix that?

    • @EverythingAroundDataverse
      @EverythingAroundDataverse  7 місяців тому +1

      The details page probably contains a query parameter like ?id=00000000-0000-0000-0000-000000000000.
      You can assign url parameters to variables like this: {% assign id = request.params['id'] %}
      And then you can add a filter to your fetchxml like this:


      This will make your query adapt to the delivery company currently being shown.
      In terms of you see only the drivers associated to the customer: That is probably within the Table Permission (found in Set up). I suspect that the permissions here are set up based on the relationship between the customer and driver, allowing only reading those associated.