Contents
How to execute and run a trigger as a system administrator?
To start, I know that you can only use System.RunAs with test methods. Now that we got that out of the way, I have a trigger that is executing an operation that the current user can’t do with their profile.
Which is the best situation for run trigger?
Situation: A trigger runs and cycles through groups of Opportunities. Some of these Opportunities are Closed Won, and most… Stack Exchange Network Stack Exchange network consists of 178 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Is it possible to simulate another user profile?
No, simulating another user/profile is not possible in the scenario you describe (and an undesirable platform feature for 3rd party code security reasons). You should always build backdoors into hard-fail validation rules for this reason.
Why does Salesforce batche 200 records in a single transaction?
This is probably because Salesforce batches 200 records in a single transaction during bulk inserts. Not sure if it’s guaranteed or documented though. The best way to test it would be to enable logs for a particular user, add a trigger with a debug statement and then insert 1000 records to a standard object using data loader.
How many times a trigger will be executed when try to insert 1000 records?
In our salesforce environment using informatica we are inserting or updating records in large number of upto 1,50,000 records in parallel. in turn of these operations triggers get fired and they call each other and some other triggers to perform some update operations. And also there are some workflows which will get fired on conditions meet.
How to answer a stack exchange question in Salesforce?
Thanks for contributing an answer to Salesforce Stack Exchange! Please be sure to answer the question. Provide details and share your research! But avoid … Asking for help, clarification, or responding to other answers. Making statements based on opinion; back them up with references or personal experience.