Adding documents manually

Discussions concerning general integration topics.

Moderator: Phil Barton

Post Reply
dfrandsen
Posts: 15
Joined: Tue Mar 03, 2009 11:33 am

Adding documents manually

Post 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.
Mark McKenna

Re: Adding documents manually

Post 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).
Post Reply