CRUD and FLS security in Apex and Visualforce

https://developer.salesforce.com/page/Testing_CRUD_and_FLS_Enforcement https://developer.salesforce.com/page/Enforcing_CRUD_and_FLS It is a common misconception that applying the with sharing keyword to Apex classes will automatically enforce CRUD or FLS security, but it does not. This keyword only controls the records returned when querying objects, so is in fact related to data security only.


Deleting Data via Batch Job

Use Anonymous Execution to call the batch class. Anonymous Apex Code:

  Batch Class:



Salesforce force.com site path case sensitive

A site consists of 3 components: The Force.com domain name that uniquely identifies your specific organization (case insensitive) The path identifies the specific site (case sensitive) A Visualforce page that is associated with your site (case insensitive) the path in the example:  locations  is case sensitive, here is a solution Read more…


Using List Custom Settings in Apex




Add users to a public group in batch

In Developer Console, press Ctr + E, bring up the Execute Anonymous Window Run following code. Replace the SOQL to find the correct users, replace the group Id.



salesforce FLOW_ELEMENT_ERROR WaitInfo

Salesforce process flow error occurred intermittently.: Debug message: FLOW_ELEMENT_ERROR||WaitInfo|myWait_myRule_01 WF_FLOW_ACTION_ERROR  (Scheduled Action) WF_FLOW_ACTION_ERROR_DETAIL|<b>An unhandled fault has occurred in this flow</b><br>An unhandled fault has occurred while processing the flow.  Please contact your system administrator for more information. The debug message doesn’t show any help information. After checking https://developer.salesforce.com/docs/atlas.en-us.salesforce_vpm_guide.meta/salesforce_vpm_guide/vpm_considerations_design_wait.htm Find: An organization can have Read more…


Time Zone Offset in Apex




visualforce page contentType Excel file name chinese 文件名 中文

Using URL encoding 1. File name in Controller

 2. File name in vf page

Reference: https://tools.ietf.org/html/rfc5987     page.5  -> 3.2.2. Examples URL Decoder/Encoder: https://meyerweb.com/eric/tools/dencoder/