Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Sales forum / OnSave Event Handler n...
Sales forum

OnSave Event Handler not executing for a custom user security role

(0) ShareShare
ReportReport
Posted on by 75

Hi,

I have a strange issue whereby a JavaScript function configured to execute OnSave is not triggering for only users with a new security role I created.

The Admin user when logged in can SAVE the record and it triggers the OnSave event. I can debug in the browser developer tools and step through the function. But if I login with a user with non admin privileges the breakpoints are never hit.

I read of similar issues where adding 'Process', 'Process Session' and 'Process Configuration' Read permission to the user role fixed the issue. I applied the same permissions to my custom role but still no joy?

Any ideas would be appreciated.

Kind Regards

M Khan

  • Verified answer
    MK77 Profile Picture
    75 on at
    RE: OnSave Event Handler not executing for a custom user security role

    Thanks for all your responses. The issue was form "Enable Security Roles" related after all.

    I am not sure whether by DEFAULT on custom form the security is only enabled for System Administrator and System Customizer Roles only OR one of my team members restricted access to these two roles.

    But on reviewing these the and enabling the form for other Roles the JS script started to download for non admin users.

    lesson learned do not assume, always check and double check especially in a team environment.

  • MK77 Profile Picture
    75 on at
    RE: OnSave Event Handler not executing for a custom user security role

    Further testing shows that in fact the JavaScript function file is not downloading for the non admin users. Still no clue why this is the case. I have removed this WebResource and added it again with no change in behaviour.

  • MK77 Profile Picture
    75 on at
    RE: OnSave Event Handler not executing for a custom user security role

    The user in question has Sales Person OOTB, Customer Service OOTB plus for the custom entities I created a separate custom role. There I have added read write permissions for the custom BPF and Custom Entities.

    Good suggestion though but might not apply in this scenario. thanks.

  • Mihir@CRM Profile Picture
    4,036 on at
    RE: OnSave Event Handler not executing for a custom user security role

    Do you get this error with an OOTB security role like Sales Person ?

    If not than copy the OOTB security role and modify it to meet your custom security role requirements.

    Hope this helps.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,238 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,923 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans