Salesforce Fact #525 | Setting application mode in test class

Do you know there is a method called setReadOnlyApplicationMode() in Test class in apex which is used to set the application mode for only read operations to simulate the behavior during service upgrade or maintenance. We cannot perform any data updates i.e. are not allowed to perform any DML operations once this scope is enabled.

Reference: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_test.htm#apex_System_Test_setReadOnlyApplicationMode

Attached is the screenshot.


 

 

 

Comments

Popular posts from this blog

Salesforce Fact #192 | Call batch apex from flow

Salesforce Fact #457 | Get current user role name in flow