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

  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: fetchXML method working in chrome but not working with IE

    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.

  • Verified answer
    Alex Fun Wei Jie Profile Picture
    33,626 on at
    RE: fetchXML method working in chrome but not working with IE

    Hi,

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

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

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: fetchXML method working in chrome but not working with IE

    Hello,

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

    Good luck.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
dkrishna Profile Picture

dkrishna 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans