Jithisha Respected Contributor.
Respected Contributor.
267 views

How to insert attachment into SM

Hi Experts,

our requirement is to insert attachments into SM. The attachments will be available unser a local folder.

Kindly suggest a way to achieve the requirement.

Thanks in advance.

Regards,

Jithisha

 

0 Likes
7 Replies
ALARMus Acclaimed Contributor.
Acclaimed Contributor.

Re: How to insert attachment into SM

Do you need attach all files from your folder to SM ?

But Attachments in SM are stored in table wich have field which talking about what table and record will have this attachments.

0 Likes
Jithisha Respected Contributor.
Respected Contributor.

Re: How to insert attachment into SM

Yes need to attach all files in folder, if file is already attached to IM then we ca ignore that attachment and rest need to be attached.

0 Likes
ALARMus Acclaimed Contributor.
Acclaimed Contributor.

Re: How to insert attachment into SM

All files into one same IM or there is some method to set which IM nubmer must be used to attach into it ?

0 Likes
Highlighted
Knowledge Partner Knowledge Partner
Knowledge Partner

Re: How to insert attachment into SM

you can do this easily using JavaScript.. check the methods getAttachments and WriteFile.
Regards,
Breno Abreu

If you feel this was helpful please click the KUDOS! thumb below!
0 Likes
Jithisha Respected Contributor.
Respected Contributor.

Re: How to insert attachment into SM

Attachments need to get attached to specific IMs only. But not sure how to achieve this requirement.

0 Likes
Jithisha Respected Contributor.
Respected Contributor.

Re: How to insert attachment into SM

I could see methods like insertAttachment(),updateAttachment(

) etc in script library. But I couldn’t find from where these methods are invoked.

Can anyone please help me to find this?

 

Thanks in advance.

Regards,

Jithisha

0 Likes
Nick_Karpushkin Respected Contributor.
Respected Contributor.

Re: How to insert attachment into SM

First you should write a script that would find the required IM (use file.doSelect() ) that you need to attach attachments to, then use readFile() to read a file from directory and then use file.insertAttachment() to add the file that you read via readFile() to the IM.

Then you can either execute the script from the ScriptLibrary itself OR you can call it from anywhere in the system where JS or RAD is available

HTH

 

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.