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
ShreyankaShreyanka 

To check if attachment is present on Case and update checkbox field

Hi everyone,

I have a requirement like, while updating case record i.e. if a specific custom picklist field value is selected, attachment should be required (Attachment is related list).

So I have created one checkbox field on case object and created record- triggered flow to
  • update the checkbox field to true if attachment is present, and
  • after uploading if attachment is deleted again it should set checkbox field to false. --> this is not working
Can someone help me on this.


Thanks in advance!
Sai PraveenSai Praveen (Salesforce Developers) 
hi Shreyanka,

Can you confirm what do you meant by not working ? Can you share the flow screenshot so can suggest based on it.

Is it not working in the insert scenario or Deletion scenario?

Thanks,
 
ShreyankaShreyanka
Hi Praveen,

Like after uploading file the checkbox is not set to TRUE. Can you tell me why it is so.
User-added image

Thanks!
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Shreyanka,

Is the flow on Case object?

Thanks,
 
ShreyankaShreyanka
Hi Praveen,

Yes on Case object.

Thanks!
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Shreyanka,

Flow on Case wont work because if we upload a file then this flow won't work as case wont get updated because of the flow. You may have to consider the trigger only in this scenerio. Because we cannot write trigger record flow on contentDocument or ContentDocumentLink.

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,