Some users may experience random login-problems to our Community. We are investigating the root cause of this. If you get an error message from CloudFlare, please send the RayID in the message to support@superoffice.com. You may also clear your browser cookies and cashe to solve it. Thanks for your understanding. 

Sentry denies Write access

lock
push_pin
done
Besvarat
5

I have a CRM-Script that edits custom-fields on a sale. But for one user, and only one user, this error message comes up. I don't understand what this means, CRM-Script doesn't check which access-rights a user has before it makes changes to the db, right?

23. maj 2025 | 01:23 em

Allt Svar (5)

CRMScript triggers execute in the current user context. You may want to encapsulate the script contents in a try/catch block to avoid unnecessary error dialogs. 

23. maj 2025 | 02:36 em

Oh, okay! But the fact that there is an error message worries me, what type of code/error creates this error message? If I want to try to fix the root of the problem. 

27. maj 2025 | 07:07 fm

Hi Beata

The error indicates that the script is trying to save a sale, where the person who saves the sale is not in the same user group as the owner of the sale. You're getting this error because CRMScript does save in context of the user, and therefore adheres to whatever rights that user has.

Look in Admin -> Roles and find the user role of the user. Look at the matrix for Sale - Other Groups. Is this set to None or Read? Or possibly Create? In that case, the user can't save sales for users in other user groups, in which case you'll get an exception in CRMScript.

 

That being said, I recently saw a very similiar error message. I eventually found out that the "after saving" trigger had been executed even though the user did not have rights to save the entity in the first place. I can't tell from your screenshot alone, but this could be happening in your case as well. I registered a bug for it: Bug ID 76494.

Espen

27. maj 2025 | 07:38 fm

Okay, great! Thank you so much :)

27. maj 2025 | 07:46 fm

I just looked into this, and the user had access to "Delete" on "other users --> sale" (And all other sale-things) in the matrix, strange! I belive that they are allowed to do the necessary changes since my scipt only changes the sale in the current context where the trigger is triggered. I applied the try-catch block, I hope that that one allows me to get a clearer error messade. 

27. maj 2025 | 07:50 fm

Lägg till svar