locked
Refreshing the Web Resource in CRM online 2015 RRS feed

  • Question

  • I create records in js on the Save Event.

    And onLoad i retrive them. But the webResource not refresh,

    and I get old values.

    What should I do?

    thanks!

    Tuesday, November 17, 2015 6:45 AM

All replies

  • Hello,

    I'm really sorry but it is unclear what is your scenario, what you've done and what doesn't work properly so please extend your description.


    Dynamics CRM MVP
    My blog

    Tuesday, November 17, 2015 6:57 AM
    Moderator
  • thanks!

    I create record in js:

    function onSave(){

    var acount={};

    acount.Name="abc";

     SDK.REST.createRecord(acount, "Acount", getAcountDetails, errorHandler);

    function getAcountDetails(acount)

    {

    alert("very nice");

    }

    }

    I have webResource that on onLoad event I retrive all the Acount's records.

     window.onload = function x() { loadAcounts(); };

    function loadAcounts()

    {

     var options = "AcountSet?$select=Name";

    SDK.REST.retrieveMultipleRecords("Acount", options, retrieveAcountCallBack, function (error) { alert(error.message); }, function () { });

    }

    function retrieveAcountCallBack(acounts)

    {

    for(var i=0;i<acounts.length;i++)

    {

    alert(acounts[i].Name);

    }

    }

    My problem is that the webResource not refresh and I get old records of acount.

    ( he doesn't retrive the new record ).

    So what should I do?

    thanks!

    Tuesday, November 17, 2015 7:18 AM
  • Hi,

    If something unclear pleas write me what.

    I'd be happy to hear about a solution.

    thanks!

    Tuesday, November 17, 2015 8:09 AM
  • Please provide your scenario because I see the code but it is still unclear when code is called. Also I have question related to line

    window.onload = function x() { loadAcounts(); };

    Do you use this js inside standard CRM form or inside HTML webresource?


    Dynamics CRM MVP
    My blog

    Tuesday, November 17, 2015 9:47 AM
    Moderator
  • Thank u very match!

    When I save the form I call onSave function.

    I use the line : window.onload = function x() { loadAcounts(); };

    inside the HTML webresource, so the loadAcounts function is called when the webResource is loaded.

    But there is Something strange:

    when I try to do it from another computer it works.

    Maybe I have problem with my explorer?

    If something still unclear pleas write me what

    thanks!

    Tuesday, November 17, 2015 1:01 PM