on 2022 Jan 06 11:47 AM
Hello,
Is it possible to read content(base64 or binary) of an attachment type attribute on script? We would like to send attachment from CPQ to ERP but I count find to way to read attachment attribute's content.
Best regards.
Request clarification before answering.
Mehmet,
The following script is used in conjunction with an API call. We utilize this by creating a URL which opens the file. I don't know much about APIs yet, but I would think you can use this concept to pull the file into your ERP. To see how this fits into the bigger picture, see my answer on your other question: https://answers.sap.com/questions/13571166/how-to-send-attachments-to-erp-from-cpq.html
if Param is not None: #check if Param is not null
if Param.docID is not None: #Check if param contains object docID
obj = SqlHelper.GetFirst('SELECT * FROM AttributeFileAttachment a WHERE a.guid=' + "'" + Param.docID + "'")
contentType = obj.contentType
Content = obj.Content
fileName = obj.FileName
ApiResponse = ApiResponseFactory.FileResponse(contentType, Content)
Hope this helps. If you figure it out, I hope you'll share your solution with us!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
9 | |
3 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.