web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

fetchXML method working in chrome but not working with IE

(0) ShareShare
ReportReport
Posted on by 245

function test() {
debugger;
var output=true;
var documents ="";
var entityId = Xrm.Page.data.entity.getId();
var fetchXml1 =
"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true' >" +
"<entity name='documents'>" +
"<attribute name='documentsid' />" +
"<attribute name='name' />" +
"<attribute name='modifiedby' />" +
"<attribute name='documenttypenewid' />" +
"<attribute name='documenttype' />" +
"<attribute name='createdby' />" +
"<order attribute='createdon' descending='true' />" +
"<filter type='and'>" +
"<condition attribute='documenttypenewid' operator='eq' value='" + entityId + "'/>" +
"</filter>" +
"</entity>" +
"</fetch>";
if (entityId !== null) {
var retrieveddocs = XrmServiceToolkit.Soap.Fetch(fetchXml1);
for (var i = 0; i < retrieveddocs.length; i++) {
var docCount=retrieveddocs.length;
var fetchXml =
"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true' >" +
"<entity name='annotation'>" +
"<attribute name='subject' />" +
"<attribute name='notetext' />" +
"<attribute name='filename' />" +
"<attribute name='annotationid' />" +
"<attribute name='modifiedby' />" +
"<attribute name='filesize' />" +
"<attribute name='isdocument' />" +
"<attribute name='createdby' />" +
"<order attribute='createdon' descending='true' />" +
"<link-entity name='documents' from= 'documentsid' to= 'objectid' link-type='inner' alias= 'ad'>" +
"<attribute name='documenttype' />" +
"<filter type='and'>" +
"<condition attribute='documentsid' operator='eq' value='" + retrieveddocs[i].id + "'/>" +
"<condition attribute='documenttypenewid' operator='eq' value='" + entityId + "'/>" +
"</filter>" +
"< /link-entity>" +
"</entity>" +
"</fetch>";

var retrievedNotes = XrmServiceToolkit.Soap.Fetch(fetchXml);//facing issue here when i do in IE node is null but same works in chrome
if (retrievedNotes.length ==0)
{
output=false;
documents +=retrieveddocs[i].attributes.vox_documenttype.formattedValue+"";
}
}
if(output !=true)
{
alert("Kindly attach the documents for " + documents)
}

}
}

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    I believe the best answer is - get in touch with developers of toolkit and ask for a help - github.com/.../issues

    Good luck.

  • Verified answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    Since you are using CRM online , I would recommend you to start using the webapi.

    docs.microsoft.com/.../xrm-webapi

  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi Divya,

    As suggested above, you can exeute fetchxml from Web API as well. refer below blog-

    www.c-sharpcorner.com/.../execute-fetchxml-with-webapi-in-dynamics-365-using-javascript

    Hope this helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans