You need to sign in to do that
Don't have an account?
Ab
Able to create account from Apex code for which user does not have permission
Hello,
I create a account from Apex code.
Account has 2 record types.
Few profiles do not have access to one of record type.
But still the apex code, creates the account with the record type which is not accessible to the the user.
What can be reason ?
I create a account from Apex code.
Account has 2 record types.
Few profiles do not have access to one of record type.
But still the apex code, creates the account with the record type which is not accessible to the the user.
What can be reason ?
Apex code runs in System context.This means apex code has not restriction in accessing or creating records. You can read more details at this link -
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_keywords_sharing.htm
Please let me know if this is helpful.
Regards,
Shashi
All Answers
Apex code runs in System context.This means apex code has not restriction in accessing or creating records. You can read more details at this link -
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_keywords_sharing.htm
Please let me know if this is helpful.
Regards,
Shashi
You need to check the class is running in with sharing or without sharing. And also you need to check the defauld record type for record and for that profile.
-Thanks
Ashlekh Gera