The CreatorCon Call for Content is officially open! Get started here.

How to delete attachment from incident in target instance when attachment is removed from incident in Source Instance using e-bonding?

Mahak2
Kilo Guru

Hello,

I have a requirement in which I need to sync(add/remove) attachments on incidents in both the instances (source and target) using E-bonding.

I have created the Custom action in flow designer for adding attachment but i am stuck on removal of attachments.

Needed help here.

Any type of suggestion would be appreciated.

 

Thanks in advance!!

3 REPLIES 3

johnfeist
Mega Sage

Hi Mahak,

When you say you've created a custom action to add the attachment, am I correct that you mean adding it on the target instance?  If so, the process is that you need to delete the attachment from sys_attachment.  To identify the record, you need three values:

  • Table Name which in your case is incident
  • Table Sys ID which identifies which incident.  In this case, it should be the correlation ID
  • Filename something like myfile.xlsx

Depending on the access you have to the target instance, you can create a direct delete action or your partner may need to include that in their api.  I haven't worked with eBonding via flow designer since when I needed to build it that functionality was not available so I don't know if you can do it all without scripting.

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster

Hello Johnfeist,

 

Thanks for your reply.

Can you please give me an example how can we do this using BR.

Also is it correct use file name as identifier for attachment in other instance as we can multiple attachments with same name attached to the records?

 

Thanks in advance!!

Hi Mahak,

I'll answer the second question first.  You need to provide all three identifiers to delete the file.  You can have many files named abc.xlsx on the other instance and you may not be the only ones eBonding with that instance.  Without the other two identifiers, there's no way of knowing which version of a given file will be deleted.

I have all of my functioning code in a set of Script Includes.  The business rules tend to be pretty simple.  They confirm that an activity needs to trigger a synch with the ebonding partner.  From there an event is triggered.

The event is picked up by a script action that ends up instantiating the necessary Script Include and running the necessary function(s).  Those functions build the headers and package, send the package, wait for a response and process accordingly.

The actual functioning code can get very lengthy and a little tricky so I'm not able to include that here.  If you have no experience coding for REST you should work with a support partner or colleague with that knowledge. (Trying to understand it all from the documentation and/or trial and error can make you crazy fast!)

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster

 

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster