-
Notifications
You must be signed in to change notification settings - Fork 1
Add an attachment to a record
JonSaffron edited this page Nov 10, 2014
·
1 revision
3e supports the adding of attachments (a word document, a PDF, a text file, an image, or any other file) to records. Out of the box, this functionality is not enabled for every archetype but it's simple to turn support on; just use the 3e IDE and set the attachment property for the required archetype to true.
To add attachments from your .net projects, you can use the AddFile method of the AddAttachment class.
AddAttachment.AddFile(string syncId, string archetypeId, Guid itemId, string originalFileName, byte[] fileContent, WindowsIdentity accountToImpersonate, string endpointName)
The parameters are as follows:
- syncId specifies a value that identifies the attachment during the upload process. This should be reasonably unique so that simultaneous uploads can be distinguished by 3e.
- archetypeId identifies by name the archetype to attach the file to.
- itemId is the id (primary key value) of the record within the specified archetype that the attachment should be associated with.
- originalFileName is the name of the file being uploaded. Do not include path data.
- fileContent is the contents of the file to attach.
- accountToImpersonate is an optional parameter specifying the windows account which will be used to run the process. The account must therefore be registered in 3e and be granted the correct permissions. If this parameter is null then 3e will add the attachment in the context of the account being used to run the application.
- endpointName is an optional parameter specifying which endpoint in the .config file will be used. This can be used to select between different 3e environments. If more than one endpoint has been defined then this parameter must be specified.