*This post is locked for comments
Hi Arpit,
using your code the outcome of alert('{{ result.ticketnumber}}'); is written beneath the rest of my entityform. This already works. There are just those records displayed, which I want to be there.
What I´m trying to achieve is:
Apply this filter to a lookup field.
Right now when I open the lookup field "parentaccount" I can see every account saved in the crm. I want to set this fetchxml filter here, so that I can only see the accounts which i filtered in the fetchxml.
How can I achieve this?
Greetings
Roman
Hi Arpit,
Thanks for your help.
Hi Evan,
Here is the correct format to fetch data using lookup condition.
For Demonstration, I have fetched all the Cases whose Customer is 'Arpit Shrivastava'
{% assign contactId = user.contactid %}
{% fetchxml my_query %}
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="incident">
<attribute name="title" />
<attribute name="ticketnumber" />
<attribute name="createdon" />
<attribute name="incidentid" />
<attribute name="caseorigincode" />
<order attribute="title" descending="false" />
<filter type="and">
<condition attribute="customerid" operator="eq" uiname="Arpit Shrivastava" uitype="contact" value="{{ contactId }}" />
</filter>
</entity>
</fetch>
{% endfetchxml %}
{% for result in my_query.results.entities %}
<script type="text/javascript">
alert('{{ result.ticketnumber}}');
</script>
{{ result.ticketnumber | escape }}
{% endfor %}
Hope it helps,
If my answer helped to resolve your issue, kindly verify it by clicking 'Yes'. It would be helpful to the other community members seeking to resolve a similar issue.
Cheers
Arpit
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156