You need to sign in to do that
Don't have an account?
ch ranjeeth
I need the trigger to be run in user mode. I have created a class with sharing and in trigger created a instance but its not respecting the user permissions....how to slove this?
global with sharing class recordcreation
{
global void method1()
{
oldmapnewmap__c o=new oldmapnewmap__c();
o.name='ranjith';
insert o;
}
}
Trigger:
trigger recordcreation on Account (before insert)
{
recordcreation rc=new recordcreation();
rc.method1();
}
The user dont have permissions on oldmapnewmap__c object but its inserting records... OWD is Private... Need help on this?
{
global void method1()
{
oldmapnewmap__c o=new oldmapnewmap__c();
o.name='ranjith';
insert o;
}
}
Trigger:
trigger recordcreation on Account (before insert)
{
recordcreation rc=new recordcreation();
rc.method1();
}
The user dont have permissions on oldmapnewmap__c object but its inserting records... OWD is Private... Need help on this?
As per Bob suggesstion , you need to alter your code like below,
Please note some the below suggesstion,
1. With sharing keyword only for Record Sharing not it will act as User mode.
2. If you are using the below class in webservice make use of global, else make it public.
Thanks.
All Answers
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_perms_enforcing.htm
As per Bob suggesstion , you need to alter your code like below,
Please note some the below suggesstion,
1. With sharing keyword only for Record Sharing not it will act as User mode.
2. If you are using the below class in webservice make use of global, else make it public.
Thanks.