Thursday, August 14, 2014

Quick Tips: Merge fields in Visualforce

As most of my colleagues know me, I have always struggled to remember fieldnames, action names and have hard time copying names of fields from Object detail page and put them onto a Visualforce page, while creating merge fields.

I just wanted to share a small tip for all those who share my "struggle" and want to have an easy way to get around that.

If you are an eclipse user, plugin comes up with a very handy tool. Following are the tips to use it:-

  1. Open visualforce page in eclipse
  2. Open right click menu
  3. Click on> Insert Merge Field
  4. Voilla, you have all the objects listed in left hand list and on selecting an object, their fields gets populated in right hand list (as shown below)

Quick Tips: Merge fields in Visualforce: Insert fields

Additionally, you can also lookup standard actions available by selecting "$Actions" in the left hand list and it would display a list of all actions available (as per screenshot below):-
Quick Tips: Merge fields in Visualforce: Insert actions

Hope this helps your visualforce development and don't make you depend on memory pills.

Saturday, March 15, 2014

Sneak Peek: Encrypted Custom Fields

Alphanumeric fields which would contain data in encrypted form. Mostly to be used in case of government regulations, as they have processing overhead and certain limitations for e.g. these fields cannot be unique, indexed or have default values. Also, there is a limit of 175 characters.

Custom encrypted fields can be be used in various applications and can be displayed on page layouts and can be even included for validations via validation rules and apex code.

Certain business needs or government regulations require certain data to be stored in encrypted state and displayed in masked form. For e.g. Social security numbers or credit card numbers. Salesforce makes it easy to achieve it via Custom encrypted fields. 

Custom encrypted fields can be created as just another custom field with type selected as "Text (Encrypted)". Master Encryption key key to be used for data encryption can be managed via "Certificate and Key Management" under Security Controls in Setup section.

A field once defined as encrypted field is displayed in masked form to all users irrespective of where the data is being accessed from. Even if data of encrypted field is displayed in debug logs, it would appear in masked form. Although, users having "View Encrypted data" permission can view data of encrypted fields in non-masked form. 

However, all encrypted fields are editable by users and abides all field level security and default security settings.

*Important: Visualforce pages seem to display non-masked data of encrypted fields to users irrespective of "View Encrypted Data" permission. Only seems to be abiding it, all other tags seem to be totally disregarding field encryption/ masking and displaying it as just another text field. 

For more information visit:-

Popular Posts