Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

error log when executing JS sample

Posted on by 790

*This post is locked for comments

  • Ahmad Saud Profile Picture
    Ahmad Saud 790 on at
    RE: error log when executing JS sample

    thanks you Goutam, i will check it.

  • Verified answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: error log when executing JS sample

    Hi Ahmad ,

    my mistake , here is the correct URL for download -

    https://marketplace.visualstudio.com/items?itemName=JLattimer.D365DeveloperExtensions

    Take a look  reference -

    www.youtube.com/watch

    www.youtube.com/watch

  • Ahmad Saud Profile Picture
    Ahmad Saud 790 on at
    RE: error log when executing JS sample

    thanks Goutam

    i am new to these extension, anyway, i did download the file but i cant compile it, any idea?

    also , if you can share any compiled version of this app and some documentation of how to use it.

    regards.

    47848.5.png

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: error log when executing JS sample

    Hi Ahmad,

    Download the visual studio developer extension where you just need to connect Dynamics CRM  solution , Map the JS to your local VS solution and right click , publish JS web resource.

    github.com/.../CRMDeveloperExtensions

  • Ahmad Saud Profile Picture
    Ahmad Saud 790 on at
    RE: error log when executing JS sample

    one more thing Mr. Goutam

    below is a JS that is validated using visual studio, but still failing with "JS filename in the error" , can you please help.

    function create_new_account() {

       var data =

           {

               "name": "Sample Account",

               "creditonhold": false,

               "address1_latitude": 47.639583,

               "description": "This is the description of the sample account",

               "revenue": 5000000,

               "accountcategorycode": 1

           }

       // create account record

       Xrm.WebApi.createRecord("account", data).then(

           function success(result) {

               console.log("Account created with ID: " + result.id);

               // perform operations on record creation

           },

           function (error) {

               console.log(error.message);

               // handle error conditions

           }

       );

    }

    error :

    _______________________

    create_new_account@win-agqoeadqke1/.../new_create_sample_account

    @win-agqoeadqke1/.../ClientApiWrapper.aspx line 157 > eval:1:1

    RunHandlerInternal@win-agqoeadqke1/.../ClientApiWrapper.aspx

    RunHandlers@win-agqoeadqke1/.../ClientApiWrapper.aspx

    ExecuteHandler@win-agqoeadqke1/.../ClientApiWrapper.aspx

    $Cb_1@win-agqoeadqke1/.../formcontrols.js

    executeHandler@win-agqoeadqke1/.../formcontrols.js

    executeHandlerByDescriptor@win-agqoeadqke1/.../formcontrols.js

    getHandler/<@win-agqoeadqke1/.../formcontrols.js

    getHandler/<@win-agqoeadqke1/.../global.ashx

    $Dd_1@win-agqoeadqke1/.../formcontrols.js

    $LI_1@win-agqoeadqke1/.../formcontrols.js

    saveInternal@win-agqoeadqke1/.../formcontrols.js

    save@win-agqoeadqke1/.../formcontrols.js

    save@win-agqoeadqke1/.../formcontrols.js

    Mscrm.CommandBarActions.saveForm@win-agqoeadqke1/.../commandbaractions.js

    Mscrm.RibbonActions.saveForm@win-agqoeadqke1/.../ribbonactions.js

    Mscrm.Utilities.executeJavascriptFunction@win-agqoeadqke1/.../global.ashx

    $Cf_1@win-agqoeadqke1/.../ribbon.js

    $Ag_1@win-agqoeadqke1/.../ribbon.js

    handleCommand@win-agqoeadqke1/.../ribbon.js

    executeCommand@win-agqoeadqke1/.../ribbon.js

    executeCommand@win-agqoeadqke1/.../ribbon.js

    click@win-agqoeadqke1/.../ribbon.js

    onClickHandler@win-agqoeadqke1/.../ribbon.js

    Function.createDelegate/<@win-agqoeadqke1/.../MicrosoftAjax.js

    b@win-agqoeadqke1/.../MicrosoftAjax.js

  • Ahmad Saud Profile Picture
    Ahmad Saud 790 on at
    RE: error log when executing JS sample

    thanks Andrew, but is there anyway were i can test my JS code without uploading it as a webresource everytime? is there any kind of simulator?

  • Ahmad Saud Profile Picture
    Ahmad Saud 790 on at
    RE: error log when executing JS sample

    thanks a lot Andrew

  • Ahmad Saud Profile Picture
    Ahmad Saud 790 on at
    RE: error log when executing JS sample

    thanks a lot.

  • Verified answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: error log when executing JS sample

    Hi Ahmad,

    When you can see some system JS file name in the error you can say the error is related to the  format of your JavaScript wbresource which is unable to build the page.

    So to debug this I would suggest always write JavaScript code inside Visual Studio and press ctrl+ k+ D same time so that you can find any syntax issue will be highlighted there.

    Once  done write the debugger; in the function

    and debug your  code find which line causes the error.

    Take a look below article.

    m.youtube.com/watch

  • Verified answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: error log when executing JS sample

    Wow. No WOW. You're a great exception because people usually drop the code here and do not want to find an answer themselves.

    Here is a good article that describes troubleshooting of JavaScript - blogs.msdn.microsoft.com/.../debugging-custom-javascript-code-in-crm-using-browser-developer-tools

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

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