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)

error log when executing JS sample

(0) ShareShare
ReportReport
Posted on by 790

*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,

    It seems that you have new_displayNameUsingformContext webresource and it contains an error. Can you post it here please?

  • Ahmad Saud Profile Picture
    790 on at

    thanks Andrew, i know i have an error in the sample web resource, my point is how to know (myself) in which line/block/keyword is the error, i cant keep asking people to debug my code :(

    thanks anyway.

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    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

  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    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

  • Ahmad Saud Profile Picture
    790 on at

    thanks a lot.

  • Ahmad Saud Profile Picture
    790 on at

    thanks a lot Andrew

  • Ahmad Saud Profile Picture
    790 on at

    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
    790 on at

    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

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    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
    790 on at

    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

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