Highlighted
Visitor..
Visitor..
149 views

How to copy attachments to an another table

Hello,

In SM 9,31 i have a need to copy attachments to a new  table. I have problem with coppying a data filed. In Java Script i simply doesnt get copied. This field in a new record is NULL. Im trying to do it like this:

...

oldAtt.data=newAtt.data

...

newAtt.doInsert()

 

note that oldAtt and newAtt has different ScFile so i cannot simply assign the whole record. Is there any way to copy the whole attachment to a different table?

0 Likes
2 Replies
Highlighted
Honored Contributor.
Honored Contributor.

Hello

I don't think that this is possible and I don't know what will you do with this. but a little info on how this works.

the attachments in each record whether its an interaction, change or whatever, the data of the attachment is not saved in the table of the module. each attachment is saved on the table sysattachment, which contains all of the attachments of the system and they are not saved like a normal record, they get saved fragmented, meaning that 1 attachment is divided into several parts and then stored in the database.

hope this gives you an idea on how the system works and allows you to find another way for your problem 

BR!

If you find that this or any other post resolves your issue, please be sure to mark it as an accepted solution.
If you are satisfied with anyone’s response please remember to give them a KUDOS by clicking on the STAR at the bottom left of the post and show your appreciation.
0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

To copy it you should know that any attachments stored in SYSATTACHMENTS table.

For example, for some attachment in interaction with incident.id=SD001 and file name is FILE001.jpg, in SYSATTACHMENTS table will be several records where:

application=incidents

topic=SD001

filename=FILE001.jpg

and field segment have value 0, 1,...

So one attachment have several records in SYSATTACHMENTS table where the value in the segment field differs.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.