How to attach an excel file present in the service export directory to a work object?
As you mentioned that the excel is present in service export directory, means you can read it. Read the excel file from the export directory.
1.Create an activity. In the activity, do the following.
2.Create a page of Data-WorkAttach-File class context.
3.Then encode the excel data stream into Base64.
4.copy the encoded value to pyAttachStream property under page step created in step 2
- save the changes to WO.
set the file location to pxProcess.pyFileUpload property.
Used Uploadfile() OOTB function to get the Base64 encoded stream of excel file.
set this stream text to pyAttachStream.
Created Data-WorkAttach-File instance and then Link-Attachment instance to attach this file with WO.