• #39392
     Anjali #7

    How many ways we can make field required in Salesforce?

    How many ways we can make field required in Salesforce?



    Hi Anjali,

    Different ways to make field mandatory :

    1.Make the field “Required” at the time of field creation by checking the “Required” check box.
    2.Make the field Required through Page Layout by checking the “Required ” checkbook in Field Properties.
    3.Validation Rules can also be used to make the field mandatory. In Error Condition Formula, one can use ISBLANK(“FieldName”);.
    4.Triggers can be used to make field mandatory. Ex. If a user try to insert the record without the field which is required, we can throw the page massage specifying to fill up required fields.(Using Trigger.addError()).
    5.One can make field mandatory through Visualforce.(If the field is getting referenced) by setting the required attribute in       <apex:inoutField> to True.

    Salesforce | shariq shariq #1


    Use addError() method in trigger to through error if that field is empty.

    Hope this helps.


    Let say you want to make contact field required.

    Edit the Contact page layout. Hover over the Title field and click on the Wrench icon. Then click Required checkbox and save.

    Setup | Customize | Contacts | Page Layouts


Viewing 4 posts - 1 through 4 (of 4 total)

Please to reply to this topic.


We're not around right now. But you can send us an email and we'll get back to you, asap.


About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2019 Forcetalks. All Right Reserved.

Log in with your credentials


Forgot your details?