Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

SDK.REST.js not working in Firefox

Posted on by 2,585

Hello Devs,

I have been using SDK.REST.js in my project.

It works fine  with IE and Chrome, but in firefox it gives Error. Any ideas?

I tested in many different versions of Firefox, same problem :(

var oppvalue = Xrm.Page.getAttribute("new_opportunitylookup").getValue();
    if ((oppvalue != null))
    {
        //var lookuptextvalue = oppvalue[0].name;
 		var lookupid = oppvalue[0].id;		
		SDK.REST.retrieveRecord(lookupid, "Opportunity", null, null, getDetails, errorHandler);	
			


in the above code, the code breaks at SDK...

I am using Dynamic CRM 2015 Online Latest Update

Thank you

*This post is locked for comments

  • Bas van de Sande Profile Picture
    Bas van de Sande 4,383 on at
    RE: SDK.REST.js not working in Firefox

    Hi

    the reason why Firefox could not resolve the success callback function is caused by the fact that Firerfox has a much more strict implementation of the javascript engine. Internet Explorer and Chrome are more forgiving in this area.

    I'm glad things worked out for you

    Bas

  • omgcrm Profile Picture
    omgcrm 2,585 on at
    RE: SDK.REST.js not working in Firefox

    Hello Bas van de Sande,

    Thanks for helping all the way down :)

    Cheers!

  • omgcrm Profile Picture
    omgcrm 2,585 on at
    RE: SDK.REST.js not working in Firefox

    Hi Guido,

    My hero :)

    Thank you So Much!!!

    The above format resolved my problem !

    I still wonder how chrome was able to reference the success callback function whereas firefox could not. ^_^

  • Bas van de Sande Profile Picture
    Bas van de Sande 4,383 on at
    RE: SDK.REST.js not working in Firefox

    Hi Guido,

    you were just ahead of me ;)

    Bas

  • omgcrm Profile Picture
    omgcrm 2,585 on at
    RE: SDK.REST.js not working in Firefox

    Hi

    here is the Screenshot of Error Found.

    c1.JPG

    function regionallookups()
    {
    var lookUpObjectValue = Xrm.Page.getAttribute("new_contactlookup").getValue();
    if ((lookUpObjectValue != null))
    {
    var lookupid = lookUpObjectValue[0].id;
    SDK.REST.retrieveRecord(lookupid, "Contact", null, null, getDetails, errorHandler);

    function getDetails(contact)
    {
    Xrm.Page.getAttribute("new_designation").setValue(contact.JobTitle);
    }
    function errorHandler()
    {
    alert("Error Fetching Contact Details");
    }
    }
    }

    its saying "getdetails in not found" even though its there.

    The problem is occurs only in Firefox not in IE and chrome.

    I tested with Xrm Service toolkit, Same error.

    Help!

    Thank You

  • Suggested answer
    Bas van de Sande Profile Picture
    Bas van de Sande 4,383 on at
    RE: SDK.REST.js not working in Firefox

    Hi,

    do you use the latest version of SDK.Rest.js?

    In your case the problem seems to be caused by an incompatibility between the SDK.Rest and Firefox.  In another thread on this forum you find a similar problem (with a possible solution).

    community.dynamics.com/.../150339

    They ended up by replacing the rest call with another call

    I hope this works out for you

    Bas

  • omgcrm Profile Picture
    omgcrm 2,585 on at
    RE: SDK.REST.js not working in Firefox

    i have written like 20+ javascripts dependent on SDK.Rest. Do you want me to change all code in them? :(

  • Bas van de Sande Profile Picture
    Bas van de Sande 4,383 on at
    RE: SDK.REST.js not working in Firefox

    I did a quick search and found a library which might be a lifesaver for you:  crmrestkit.codeplex.com

  • omgcrm Profile Picture
    omgcrm 2,585 on at
    RE: SDK.REST.js not working in Firefox

    Hello Bas van de Sande,

    Yes the problem appears on many multiple systems using firefox.

    The javascript which is not dependent on SDK.Rest.js works fine, but the ones which are depending are giving errors.

    Thank you

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans