05-10-2013 03:41 AM
I try to add a new picture to Act, but it can not work.
I am not sure the way is correct :
Act.Framework.SupplementalFiles.Attachment att = m_ActFramework.SupplementalFileManager.CreateAttachment(Act.Framework.SupplementalFiles.AttachmentMate.Note, "C:\\TO.jpg", "testname", true);
It will error catch in " m_ActFramework.SupplementalFileManager.AddAttachment(att, actContact.ID); "
The error message is " The INSERT statement conflicted with the FOREIGN KEY constraint \"ATTACHMENT_NOTEID_FK\". The conflict occurred in database \"penpower\", table \"dbo.TBL_NOTE\", column 'NOTEID'.\r\nThe statement has been terminated. "
Thanks for all.
05-10-2013 07:12 AM
There are a couple of examples already in the forum for creating attachments:
There are more but these two both include sample code. The thing to keep in mind is that an attachment on the documents tab is a History of type Library Document.
Hope this helps.