Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Clear an Attachment field based on parent answer

Jacqueline
Contributor III

Hello,

I have an a Parent field (1A) that requires an attachment (1B) if answered Yes.  If Parent 1A is Yes and an attachment is added to 1B but then the user changes the Parent 1A to No, I'd like to clear out the attachment if they did not.   I'm unable to do this with DDEs or datafeeds since we cannot evaluate an attachment field in a rule, report, etc.

Does anyone have custom code that will look to the parent and then clear the attachment field, if necessary?  

 

Any help or input is appreciated! 

 

 

4 REPLIES 4

DavidPetty
Archer Employee
Archer Employee

Jacqueline, you can do this with a data feed and a report.  Create a calculated numeric field for the attachment field, COUNT([Attachment Field Name]).  Then in the report add the filter for the question and the calculated numeric field greater than 0.

 

 Advisory Consultant

Thank you David.  Apologies as I should have mentioned that I we have maybe 15 or 20 of these fields per application (and several applications) so we're trying to stay away from adding so many data feeds.  I do currently have datafeeds clearing Text Fields and User Lookup fields but the reports contain all fields in one report and those that do not need to be cleared are just written over with the same data in there.  Unfortunately, I cant grab the value of the attachment and re-populate it.

No worries Jacqueline.

 

Your best bet then is to use a custom object to clear the fields being there are so many.

 Advisory Consultant

Is there any guidance around custom objects?