Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Answered

On Save Event doesn't work

(3) ShareShare
ReportReport
Posted on by 1,027
Hi, All.
Why so easy Event doesn't work?
 
  • Suggested answer
    Amit Katariya007 Profile Picture
    Amit Katariya007 10,203 Super User 2025 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.
  • Verified answer
    Kipetcoff Profile Picture
    Kipetcoff 1,027 on at
    On Save Event doesn't work
    I found the problem.
    JS syntax wa incorrect
  • Kipetcoff Profile Picture
    Kipetcoff 1,027 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 10,203 Super User 2025 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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,468 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,289 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans