+ Start a Discussion

validation rules for Attachment object

I have created the record in custom object in the related list nots and attachments i need to attach only one attachment not more than one.Can anybody Suggest how to achieve this either validation rule or trigger.
Balaji BondarBalaji Bondar
Hi Ramachandra,

You have to write a trigger(before insert) on trigger object to make sure only one attachment against that object.
Please refer below code to see how you can write a trigger with your custom logic:

Important :
If this is what you were looking for then please mark it as a "SOLUTION" or You can Click on the "Like" Button if this was beneficial for you.