Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Sales forum / OnSave Event Handler n...
Sales forum
Answered

OnSave Event Handler not executing for a custom user security role

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
    MK77 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
    MK77 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
    MK77 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
    Mihir@CRM 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.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,459 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,862 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans