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
Raju Chi 5Raju Chi 5 

Attachment check using lightning component

Hi Team,

I have requirement like before click on submit for approval button validate attachemnt is present or not for custom object.

If attachment is not there then show the error message otheriwse submit for the approval.

how to achive this using custom lightning component button withour using trigger.

Regards,
Raj
PriyaPriya (Salesforce Developers) 
Hi Raju,

Kindly query on Attachment with parent id being your record id. If the query returns 0 rows, display the validation. Else submit for approval on click of button.
 

Please mark as Best Answer so that it can help others in the future.

Regards,

Priya Ranjan