function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Chandu017Chandu017 

validation rules for Attachment object

Hi,
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:
https://help.salesforce.com/HTViewSolution?id=000181538

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.