Have you checked if the profile has the right to run that particular class? Next to each class, click Security to grant access or go to the Profile and at the bottom, you'll see Enabled Apex Class Access. Also they may need API Enabled checkbox checked??
You may need to look into the field level security for the profile running the APEX code. If that field is set to hidden than you will probably get a null pointer exception.
I know the object on which it is erroring. I am trying to dtermine why would the apex code run fine with one profile and error out with null pointer with another profile
I checked the field security for both profiles and it is the same. Both profiles have access to the apex class. There must be some reasoning for this.
No it wont matter who deploys the code. My current
thinking is that it maybe to do with the security settings, e.g. If you have
private Accounts and the code is trying to update an Account that does not
belong to you and you have no access over through any sharing rules.
It’s
difficult for me to comment as haven’t seen a debug trace of your code running
though.
This is an opp created by the user in this standard user profile and on save the apex code triggers. So the opp is owned by that user. The user gets a null pointer wiht the above message
Assuming that you might want to see more photographs of our new positions, kindly follow the connection to our Instagram page. We have finished many intriguing tasks and we desire to have the option to help you, with anything that you could need doing.
Have you checked if the profile has the right to run that particular class? Next to each class, click Security to grant access or go to the Profile and at the bottom, you'll see Enabled Apex Class Access. Also they may need API Enabled checkbox checked??
Message Edited by jyoti on 06-12-2008 06:11 PM
You may need to look into the field level security for the profile running the APEX code. If that field is set to hidden than you will probably get a null pointer exception.
The apex code runs only for sysadmin profile. All other profiles get this null pointer exception.
Have you tried logging the debug trace?
Setup --> Monitoring --> Debug Logs
Would be interesting to see what is in that.
But this same code runs fine for Sysadmin profile
Message Edited by MDXHiker on 06-12-2008 10:48 PM
Looks like you my need to include some debug logging with System.Debug();
I find it helpful to debug entire objects with issues like this and this should help you find the object that is giving you the issues.
I am trying to dtermine why would the apex code run fine with one profile and error out with null pointer with another profile
I checked the field security for both profiles and it is the same.
Both profiles have access to the apex class. There must be some reasoning for this.
Does it matter who deploys the codes?
No it wont matter who deploys the code. My current thinking is that it maybe to do with the security settings, e.g. If you have private Accounts and the code is trying to update an Account that does not belong to you and you have no access over through any sharing rules.
It’s difficult for me to comment as haven’t seen a debug trace of your code running though.
So the opp is owned by that user. The user gets a null pointer wiht the above message
Same scenario for Sysadmin, works fine
I'm afraid i would need to see the code and a full debug log to help any further.
Feel free to PM it to me if you like.
Assuming that you might want to see more photographs of our new positions, kindly follow the connection to our Instagram page. We have finished many intriguing tasks and we desire to have the option to help you, with anything that you could need doing.
Source: painter and decorator chelsea (https://www.lgcdecorators.co.uk/painters-decorators-west-london/chelsea/)