HOW TO CHECK WHETHER A RECORD HAS BEEN LOCKED IN THE APPROVAL PROCESS | Techila
1847
single,single-post,postid-1847,single-format-standard,ajax_updown_fade,page_not_loaded,,qode_grid_1300,footer_responsive_adv,hide_top_bar_on_mobile_header,qode-content-sidebar-responsive,qode-theme-ver-9.4.2,bridge,wpb-js-composer js-comp-ver-4.12,vc_responsive
 

HOW TO CHECK WHETHER A RECORD HAS BEEN LOCKED IN THE APPROVAL PROCESS

HOW TO CHECK WHETHER A RECORD HAS BEEN LOCKED IN THE APPROVAL PROCESS

HOW TO CHECK WHETHER A RECORD HAS BEEN LOCKED IN THE APPROVAL PROCESS

Have you been wondering how to check whether a record has been locked? I thought there might be a field which says that. But I was not able to find any such field. Instead I found that ProcessInstance table can be used to find if a record has been locked. But that looks very tedious and complex.

How about a very simple way,

Step 1: Create a field (say FLAG) of type Checkbox. Set the default value to UNCHECKED.

Step 2: In your Approval Process in the INITIAL SUBMISSION Action, create a Field Update. Update the FLAG to TRUE.

Step 3: In your FINAL APPROVAL and REJECTION Actions, create a Field Update. Update the FLAG back to FALSE.

Step 4: And done!!!! You can now find whether a record has been locked simply by checking the FLAG value. Be it in your Apex Class or Visualforce Page.

Courtesy:  http://www.forcetree.com/2009/06/how-to-check-whether-record-has-been.html

“Explore – Techila Global Services, A Salesforce development company”

Author: techila

No Comments

Post A Comment