Monday, 3 September 2012

Few Intresting Tips On Making a Field Mandatory On Visualforce Page


Inspecting the CSS of the salesforce and playing around a bit we can easily make a field look like a required field with the help of below snippet





The validation can be easily handled at the back end and a small code that will be helping is below

if(is error){
ApexPages.addmessage(new ApexPages.Message(ApexPages.Severity.Error, 'Error Message.........'));
}
 tag has to be added in the page to display the error to the user.

4 comments:

  1. We have a attribute called "required" where we can set to true to make a field mandatory to enter by User

    ReplyDelete
  2. Say you have inputtext as search criteria or something you want to make it required ?If inputfield then its good approach to use that attribute but for text box a complete native visualforce can be this!

    ReplyDelete
  3. Thank you for sharing this.
    If you are looking to work, live or study in an English-speaking country, then you must be able to demonstrate a high level of English language ability.
    Online IELTS Course

    ReplyDelete
  4. Thank you for sharing this.
    IIn chemical engineering, Process Design Engineering Course is the design of processes for desired physical and/or chemical transformation of materials.
    Online Process Design Course

    ReplyDelete

Introducing Lightning Base Components

Lightning Base Components are great addition to the platform and in fact revolutionary .One of the concerns around lightning component ...