In Dynamics-365 customer portal site, i created a web page which basically will show all assets-installed in a grid under a customer account.
For that, i created a entity-list which has 6 views to render.
For some objective purpose, i need the columns names(which i am calculating in below given code) to be passed to the javascript funtion.
If i change the view and click on the Download button then it should pass column names to the function.
But alas i am getting only Empty string everytime. Does there exists any way to solve this?
The skeleton of the page is like as below:
{% assign data = "" %}
{% assign columns = "" %} // columns will come from a dynamic configuration
{% entitylist id:page.adx_entitylist.id %}
<div class="navbar navbar-default">
<a href="#" title="Download" onclick="downloadAssets('{{data}}')" >Download</a>
</div>
<div>
<ul class="dropdown-menu" role="menu">
{% for view in entitylist.views -%}
{% assign view_name = view.name | split: '-' %}
<li{% if params.view == view.id %} class="active"{% endif %}>
<a href="{{ request.path | add_query:'view', view.id }}">{{view_name.last}}</a>
</li>
{% endfor -%}
</ul>
</div>
{% entityview id:viewid, search:params.search, order:params.order, page:params.page, pagesize:params.pagesize, metafilter:params.mf %}
{% assign data = "" %}
{% for c in entityview.columns %}
{% if columns contains c.logical_name %}
{% assign data = data | append: c.logical_name %}
<div> {{data}} </div>
{% endif %}
{% endfor %}
{% endentityview %}
{% endentitylist %}
<script>
function downloadAssets(data){
console.log(data);
}
</script>
2
Answers
I don’t know Liquid but may be this snippet of code could help you. I did retrieve the column metadata in one of my project. One of the difficulty was the find the object containing the translation:
Try this instead: