Skip to main content

Notifications

Announcements

No record found.

Service | Customer Service, Contact Center, Fie...
Suggested answer

On Save Event doesn't work

(1) ShareShare
ReportReport
Posted on by 1,010
Hi, All.
Why so easy Event doesn't work?
 
  • Suggested answer
    Amit Katariya007 Profile Picture
    Amit Katariya007 8,832 Super User 2024 Season 1 on at
    On Save Event doesn't work
    Glad to hear that! Sharing the code would have made it easier to identify the issue.
     
    In most cases, if there is a syntax error, the JavaScript file won't load at all.
  • Kipetcoff Profile Picture
    Kipetcoff 1,010 on at
    On Save Event doesn't work
    I found the problem.
    JS syntax wa incorrect
  • Kipetcoff Profile Picture
    Kipetcoff 1,010 on at
    On Save Event doesn't work
    @Amit Katariya007 thank you for quick answer.
    Everything chaekd 100 times. Could you send me super easy JS with function?
    Just to test event. I don't understand why event can't see my function. I think format incorrect
  • Amit Katariya007 Profile Picture
    Amit Katariya007 8,832 Super User 2024 Season 1 on at
    On Save Event doesn't work
    The error message indicates that Dynamics 365 is trying to execute a JavaScript function named test from the web resource awr_requestjs, but the function does not exist in the script. Here’s a step-by-step approach to troubleshoot and resolve the issue:
     
    1. Verify the Web Resource
    Open the Dynamics 365 instance and navigate to Settings > Customizations > Customize the System.
    Under Web Resources, locate awr_requestjs.
    Open the script and check if a function named test is defined in the file.
     
    2. Update the Form Script
    Go to the entity where the script is attached (e.g., Account, Contact, etc.).
    Open the Form Editor for the specific form.
    Under Form Properties, check the Event Handlers for the OnSave event.
    Ensure that the function name specified matches an existing function in the awr_requestjs script.
     
    3. Correct the Function Reference
    If the function name is incorrect or missing in the script:
    Open the awr_requestjs web resource.
    Add or rename the function to test (if it matches the intended functionality).
    If the test function is unnecessary, update the event handler to reference the correct function name or remove the handler.
     
    4. Save and Publish
    After making changes, save the script and publish all customizations.
    Test the form by triggering the OnSave event to ensure the error is resolved.
     
    5. Debugging Tips
    Use the Browser Developer Tools (F12) to check the JavaScript console for additional error details.
    Download the log file as suggested in the error message for further insights.
    Add debugging logs (console.log) or alerts in the script to confirm if it’s executing as expected.

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,560 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans