- September 27, 2018 at 1:57 pm #39392Anjali #7
How many ways we can make field required in Salesforce?
How many ways we can make field required in Salesforce?September 27, 2018 at 2:05 pm #39393Anurag algoworks #12
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.September 29, 2018 at 11:26 am #40924shariq #1
Use addError() method in trigger to through error if that field is empty.
Hope this helps.September 30, 2018 at 12:31 am #41269
Please Register to reply to this topic. /