I want to add some URLs as attachments to a business object (2017.3) using the SOAP API.
If you're in the ISM GUI you have to options:
- "Add Attachment", which adds the file as BLOB to the table "FusionAttachments" with a reference stored in "FusionAttachments"
- "Add URL", which only adds a URL in "FusionAttachments" without using the BLOB storage
![]()
I have already tried various options but wasn't able to only add a URL:
- "RestrictedFileExtension":
ObjectAttachmentCommandData attachmentData = new ObjectAttachmentCommandData()
{ ObjectId = "CCE04B00A3BF44C4BCD05F52EFEB3A69", // Service RecId ObjectType = "CI#Service", URL = "https://www.google.de"
};
ObjectAttachmentCommandData attachmentData = new ObjectAttachmentCommandData()
{ ObjectId = "CCE04B00A3BF44C4BCD05F52EFEB3A69", // Service RecId ObjectType = "CI#Service", fileName = "https://www.google.de", URL = "https://www.google.de"
};
- "Value cannot be null.\nParameter name: attachmentBody"
ObjectAttachmentCommandData attachmentData = new ObjectAttachmentCommandData()
{ ObjectId = "605CF529BC9A4674AF275E168DF40F75", // Service RecId ObjectType = "CI#Service", fileName = "https://www.google.de/Test.docx", URL = "https://www.google.de/Test.docx"
};
The only currently working option for me is to
- add a dummy (allowed) extension to the fileName
- add a dummy byte array
This doesn't look good and is far from optimal since it only works for hyperlinks referring to documents:
byte[] dummyAttachment = new byte[] { 0x00 };
ObjectAttachmentCommandData attachmentData = new ObjectAttachmentCommandData()
{
ObjectId = "605CF529BC9A4674AF275E168DF40F75", // Service RecId ObjectType = "CI#Service", fileName = "Test.docx", URL = "https://www.google.de", fileData = dummyAttachment
};