Page 1 of 1
Adding documents manually
Posted: Wed Oct 21, 2009 6:34 pm
by dfrandsen
Is there any way through the API to manually add documents to SPImage? I'd like to be able to mimic the behavior that occurs when you use the Publish button on the Documents tab in ProForm.
Re: Adding documents manually
Posted: Fri Oct 30, 2009 2:48 pm
by Mark McKenna
You should be able to do this:
Code: Select all
private void AddAttachment( SoftPro.OrderTracking.Client.IOrder order, string file )
{
try
{
SoftPro.OrderTracking.Client.IDocumentImage documentImage = order.DocumentImage.CreateNew( );
documentImage.Trustee = order.CurrentUser;
documentImage.OriginalLocation = new Uri( file );
documentImage.Description = "My Description";
documentImage.DocumentImageTypeID = SoftPro.OrderTracking.Client.DocumentImageType.Attached;
}
}
When the order is saved, the storage item will be pushed through whatever document storage system is currently registered in the Integration service (
StorageSystem attribute).