You are viewing limited content. For full access, please sign in.

Question

Question

Add attachment to a topic using Laserfiche SDK

asked on October 21, 2015

Hi,

 

I am creating a topic using laserfiche SDK using below code. I create topic successfully without attachment but I am not able to add attachment to topic.

LFTopic t = new LFTopic(); 
t.Title = EntryID+" 0"; 
t.Create(discussions[1] as ILFDiscussion, "Visibility test");

//void Create(object pDiscussion, string firstComment, Array Attachments = null);

In above method to Create a topic, what should I pass as parameter for "Array Attachments". Should it be an array of type string or byteArray or something else? should it be array having document path or something else?

Please help me understand the meaning and usage of Array Attachment parameter. If provide please provide me some sample code.

 

Thanks

Sanjay C

0 0

Replies

replied on October 22, 2015

Attachments should be an array of ILFCommentAttachments.  So you might have code like:
 

LFTopic t = new LFTopic();
t.Title = EntryID+" 0";

Object[] attachments = new Object[total];

for (int i = 0; i < linkedIds.Count; i++) // linkedIds is an array of entry ids to link to
{

    ILFCommentAttachment att = new LFCommentAttachmentClass();
    attachments[i] = att;
    att.DocumentID = linkedIds[i];
    att.Description = "Document " + att.DocumentID;
}

t.Create(discussions[1] as ILFDiscussion, "Visibility test", attachments);

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.