Friday 20 January 2017

How to use Fetch XML in ADXStudio Liquid Template

Liquid is an open-source template language integrated into Adxstudio Portals. It can be used add dynamic content to pages, and to create a wide variety of custom templates.

You can learn more about Liquid Template from ADXStudio Community:

https://community.adxstudio.com/products/adxstudio-portals/documentation/configuration-guide/liquid-templates/

In this post I would like to explain, how we can use Fetch XML to retrieve data from CRM in Liquid Template.


  1. {% fetchxml my_query %}
  2.   <fetch version="1.0" mapping="logical">
  3.   <!-- Write FetchXML here, use Liquid in here if you want, to build XML dynamically. -->
  4.   </fetch>
  5. {% endfetchxml %}
  6.  
  7. {{ my_query.xml | escape }}
  8. {{ my_query.results.total_record_count }}
  9. {{ my_query.results.more_records }}
  10. {{ my_query.results.paging_cookie | escape }}
  11. {% for result in my_query.results.entities %}
  12.   {{ result.id | escape }}
  13. {% endfor %}
  14.  
  15. <!-- You can also filter results by Entity Permissions -->
  16. {% fetchxml secure_query enable_entity_permissions: true, right: 'read' %}
  17. {% endfetchxml %}




Note - You must have appropriate Entity Permissions for data to be correctly retrieved. 
For example if you retrieving Contact Entity data using Liquid Template Fetch XML then you must have appropriate Entity Permissions on Contact Entity. (Contact, Account, Parent, Global).

1 comment:

  1. Special thanks to (hackingsetting50@gmail.com) for exposing my cheating husband. Right with me i got a lot of evidences and proofs that shows that my husband is a fuck boy and as well a cheater ranging from his text messages, call logs, whats-app messages, deleted messages and many more, All thanks to

    (hackingsetting50@gmail.com), if not for him i will never know what has been going on for a long time.

    Contact him now and thank me later.

    ReplyDelete

Blogger Widgets