Attach files programmatically using x++

It’s working now. The preview is showing [emoticon:33306c418930400bac28808410f8ac8b]

thanks for your time Martin. I really really appreciate this.

Hi can you please share your code , I need to attach file using x++ code and attach file from sftp

Can you explain your problem, please?
Let’s say you want to use DocumentManagement::attachFileToCommon().
You’ll need to provide a few parameters:

  • _refRec - the record to which the file will be attached
  • _type - We discussed it above
  • _file - A file stream that you’ll get by reading the file
  • _fileName - File name from FTP
  • _fileContentType - We discussed it above
  • _attachmentName - I guess you can come up with a name