I am having this issue where the code below does not return anything. The logical name dyn365bc_bssipmtpostedsalesinvoices_bssi_portal_v2_0 is a virtual table. I have attached my table permissions as well. Anyone knows what's the issue?
{% fetchxml PostedSalesInvoices %}
{% assign params=request.params['Data'] | split:',' %}
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="dyn365bc_bssipmtpostedsalesinvoices_bssi_portal_v2_0">
<attribute name="dyn365bc_closed" />
<attribute name="dyn365bc_currencycode" />
<attribute name="dyn365bc_no" />
<attribute name="dyn365bc_postingdate" />
<attribute name="dyn365bc_duedate" />
<attribute name="dyn365bc_totalamountincludingtax" />
<attribute name="dyn365bc_remainingamount" />
<attribute name="dyn365bc_customernumber" />
<attribute name="dyn365bc_paymentstatus" />
<attribute name="dyn365bc_discountdate" />
<attribute name="dyn365bc_discountamount" />
<attribute name="dyn365bc_shortcutdimension1code" />
<filter type="or">
{% for param in params %}
<condition attribute="dyn365bc_customernumber" operator="eq" value="{{param}}" />
{% endfor %}
</filter>
</entity>
</fetch>
{% endfetchxml %}
{% if PostedSalesInvoices.results.entities.size > 0 %}
{% assign resultJson = PostedSalesInvoices.results.entities %}
{% endif %}
{% for res in resultJson %}
{% assign invoiceCurrency = res.dyn365bc_currencycode %}
<script>
alert('jsonArr');
jsonArr.push({
Customer_No: '{{res.dyn365bc_customernumber}}',
Currency_Code: '{{res.dyn365bc_currencycode}}',
Document_No: '{{res.dyn365bc_no}}',
Closed: '{{res.dyn365bc_closed}}',
Remaining_Amount: '{{res.dyn365bc_remainingamount | decimals: 2}}',
Posting_Date: '{{res.dyn365bc_postingdate | date: "yyyy-MM-dd" }}',
Due_Date: '{{res.dyn365bc_duedate | date: "yyyy-MM-dd" }}',
Original_Amount: '{{res.dyn365bc_totalamountincludingtax | decimals: 2}}',
Payment_Status: '{{res.dyn365bc_paymentstatus}}',
Pmt_Discount_Date: '{{res.dyn365bc_discountdate | date: "yyyy-MM-dd" }}',
DimensiodeCode: '{{res.dyn365bc_shortcutdimension1code}}'
});
</script>
{% endfor %}
Thanks!