web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Power Pages Portal - V...
Power Pages
Unanswered

Power Pages Portal - Virtual Tables - Fetch XML returning "Liquid error: Exception has been thrown by the target of an invocation."

(0) ShareShare
ReportReport
Posted on by 14

Hi everyone,

 

I am experiencing this issue when running this liquid code (fetchXML)  in one of my portal pages.

The error message that I am getting is "Liquid error: Exception has been thrown by the target of an invocation.". This error message only shows when I am calling my fetchXML with one of my virtual table entities.

 

I also have my table permission set for the entities.

 

I have checked the size of my entities '{{ PaymentGatewayInformation.results.entities.size }}' and the return is 0.

 

Here's my code: 

 

{% fetchxml PaymentGatewayInformation %}

{% assign custNo = request.params['custNo'] %}
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
  <entity name="dyn365bc_bssigatewayprocess_bssi_portal_v2_0">
    <attribute name="dyn365bc_customerno" />
    <attribute name="dyn365bc_paymentgateway" />
    <attribute name="dyn365bc_paymentgatewayid" />
    <filter type="and">
      <condition attribute="dyn365bc_customerno" operator="eq" value="{{custNo}}" />
      <condition attribute="dyn365bc_paymentgateway" operator="eq" value="0" />
    </filter>
  </entity>
</fetch>
{% endfetchxml %}
{% if PaymentGatewayInformation.results.entities.size > 0 %}
  {% assign resultJson = PaymentGatewayInformation.results.entities %}
{% endif %}

{% for res in resultJson %}
  {% assign customerNo = res.dyn365bc_customerno %}
  {% assign paymentGatewayId = res.dyn365bc_paymentgatewayid %}
{% endfor %}
 
I have chekced the 
 
Any help would be highly appreciated! 
 
Thanks,
Aman
Categories:
I have the same question (0)
  • Resolutions Profile Picture
    125 on at

    @amandeep It seems like the issue might be related to the fetchXML query not returning any results for the PaymentGatewayInformation entity. Here are a few things you can check to troubleshoot the issue:

     

    Verify Entity Name: Double-check that the entity name "dyn365bc_bssigatewayprocess_bssi_portal_v2_0" is correct and matches the actual entity name in your Dynamics 365 environment.

     

    Ensure Data Exists: Make sure that there is data in the "dyn365bc_bssigatewayprocess_bssi_portal_v2_0" entity that matches the filter criteria specified in your fetchXML query.

     

    Check Permissions: Ensure that the user context executing the liquid code has appropriate permissions to read data from the "dyn365bc_bssigatewayprocess_bssi_portal_v2_0" entity in Dynamics 365.

     

    Review Filter Conditions: Verify that the filter conditions in your fetchXML query are correct and that they match the data in your Dynamics 365 environment. In your case, ensure that there are records where "dyn365bc_customerno" equals the value of "{{custNo}}" and "dyn365bc_paymentgateway" equals 0.

     

    Error Handling: Add error handling to your liquid code to catch any potential exceptions and provide more detailed error messages for debugging purposes.  

     

    By verifying these aspects, you should be able to identify the root cause of the issue with your fetchXML query and resolve the "Liquid error: Exception has been thrown by the target of an invocation." message.

     

    If I have answered your question, please mark your post as Solved. If you like my response, please give it a Thumbs Up. Remember, every challenge is an opportunity for growth.

  • amandeep Profile Picture
    14 on at

    Hi @Resolutions,

     

    I have reviewed and checked all the things you mentioned but nothing worked. The odd part is that this was working a month ago, and now is giving me this error message. Do you think it could have been an API issue?

     

    Thanks,

    Aman

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard