Lock/Unlock Field on Form/BPF


There are 2 ways to Lock or Unlock the field on form:

1. Using Business Rule

Business Rule is simplest way to lock/unlock the field on form. It can be also used to show/Hide field on form or showing any error message on form or making field mandatory/non-mandatory.

Note: Business Rule can not work on fields present in Business Process Flow(BPF).

2. Using JavaScript : 

Following steps are used to lock/Unlock field on form: 

  • Use formContext object model
  • get control of field using formContext object model
  • use setDisabled property to lock/unlock the field
Syntax: 
           formContext.getControl(arg).setDisabled(bool);

arg: Schema name of field
bool: true for locking the field and false for unlocking the field

In order to Lock/Unlock the field in BPF, use "header_process_schemaname" as a argument.

eg. if First Name field with schema name as firstname is present in BPF and you have to lock the First Name field in BPF, then use following syntax: 
        
        formContext.getControl("header_process_firstname").setDisabled(true);

Comments

Popular posts from this blog

Accessing Fields on QuickView Form through javaScript

ADF - (Part 2) Integrate Data From CRM to External system

ADF - (Part3) Integrate Data From CRM to External system Using Stored procedure