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

Community site session details

Session Id : UWOe2yQOhvGmms1PGsZQkv
Power Pages - General Discussions
Unanswered

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

Like (0) ShareShare
ReportReport
Posted on 25 Apr 2024 17:54:11 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)
  • amandeep Profile Picture
    14 on 29 Apr 2024 at 16:54:28
    Re: Power Pages Portal - Virtual Tables - Fetch XML returning "Liquid error: Exception has been thrown by the target of an invocation."

    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

  • Resolutions Profile Picture
    125 on 27 Apr 2024 at 17:59:25
    Re: Power Pages Portal - Virtual Tables - Fetch XML returning "Liquid error: Exception has been thrown by the target of an invocation."

    @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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Pages

#1
Jon Unzueta Profile Picture

Jon Unzueta 61 Super User 2025 Season 2

#2
Fubar Profile Picture

Fubar 57 Super User 2025 Season 2

#3
Shafiuddin Profile Picture

Shafiuddin 45

Last 30 days Overall leaderboard
Loading complete