У меня есть код ajax для возврата полей из моей базы данных. Он работал нормально, затем я добавил пару атрибутов, и он возвращает ошибку, однако он отвечает полными данными для атрибута, поэтому я уверен, что он помечен правильно.
Когда я удаляю атрибут 'description', он начинает работать нормально. У меня была похожая проблема с атрибутом c9_picture1. Я обошел его, создав новое поле с теми же данными, но с другим именем, и оно работало нормально. Я не могу легко сделать то же самое здесь, поскольку поле описания используется в другом месте системы. V1 не работает, V2 работает отлично, единственное отличие состоит в том, что V1 один имеет эти две строки:
<attribute name="description" />
и
"Description": "{{ item['casenote.description'] }}",
вся помощь оценена Спасибо.
V1
{% fetchxml feed %}
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="c9_membership">
{% if request.params['clientid'] %}
<filter type="and">
<condition attribute="c9_membershipid" operator="eq" uitype="client" value="{{ request.params['clientid'] }}" />
</filter>
{% endif %}
<link-entity name="c9_casenotesactivity" from="c9_clientlookup" to="c9_membershipid" link-type="inner" alias="casenote">
<attribute name="pwc_mainimage" />
<attribute name="sortdate" />
<attribute name="activityid" />
<attribute name="subject" />
<attribute name="description" />
<filter type="and">
<condition attribute="pwc_mainimage" operator="not-null" />
</filter>
</link-entity>
</entity>
</fetch>
{% endfetchxml %}
[
{% for item in feed.results.entities %}
{
"CaseNote": {
"Image": "{{ item['casenote.pwc_mainimage'] }}",
"Date": "{{ item['casenote.sortdate'] }}",
"NoteID": "{{ item['casenote.activityid'] }}",
"Description": "{{ item['casenote.description'] }}",
"Subject": "{{ item['casenote.subject'] }}"
}
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
]
v2
{% assign clientid = request.params['clientid'] %}
{% fetchxml feed %}
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="c9_membership">
{% if request.params['clientid'] %}
<filter type="and">
<condition attribute="c9_membershipid" operator="eq" uitype="client" value="{{ request.params['clientid'] }}" />
</filter>
{% endif %}
<link-entity name="c9_casenotesactivity" from="c9_clientlookup" to="c9_membershipid" link-type="inner" alias="casenote">
<attribute name="pwc_mainimage" />
<attribute name="sortdate" />
<attribute name="activityid" />
<attribute name="subject" />
<attribute name="description" />
<filter type="and">
<condition attribute="pwc_mainimage" operator="not-null" />
</filter>
</link-entity>
</entity>
</fetch>
{% endfetchxml %}
[
{% for item in feed.results.entities %}
{
"CaseNote": {
"Image": "{{ item['casenote.pwc_mainimage'] }}",
"Date": "{{ item['casenote.sortdate'] }}",
"NoteID": "{{ item['casenote.activityid'] }}",
"Description": "{{ item['casenote.description'] }}",
"Subject": "{{ item['casenote.subject'] }}"
}
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
]