You are here: Reference Guides > Designer Form Controls (A-Z) > Ws.Attachment

Ws.Attachment

The Ws.Attachment control enables users to attach files or documents to a form. Note that Winshuttle Workflow only supports attaching documents through Ws.Attachment. Attaching files through Microsoft InfoPath is not supported.

Download example (.wssln file)

Attachments in the following file formats can be uploaded:

  • PDF
  • TIFF
  • JPEG
  • PNG
  • DOC / DOCX
  • XLS / XLSX
  • TXT

Ws.Attachment Properties

Property

Description

Allow Deletion

Enables the deletion of files that have been uploaded previously.

Allow Replacement

Enables the replacement of files that have been uploaded previously.

Allow Upload

Enables the uploading of files.

Hide Existing Attachments

Hides the attachments that have been uploaded previously.

Include Inline

Allows the attachments in the form to be displayed inline in the form.

Maximum

The maximum number of attachments that are required before the form can be submitted.

Message

The message to display if the minimum or maximum requirement is not met.

Minimum

The minimum number of attachments that are required before the form can be submitted.

Require Review

Requires that the user click on the attachments and view them before they can proceed.

Target

A label that you can enter to make the attachment display in another browser. The special _blank target will always bring up the attachment in a new window. If you use anything other than _blank the attachment will be brought up in the browser that already has that label, if it exists. Otherwise, it opens a new browser window.

Adding the Control to a form

Back to top

After generating an InfoPath form, add the Ws.Attachment control to the form. The binding of this control must be set to the FILE_BYTES field.

The ‘SAP Web Service’ button and the attachment control must both be displayed on the same form view.

The end user is required to select the local file to be attached before pressing the ‘SAP Web Service’ button. Use validations to ensure that a file has been selected before attempting posting to SAP.

You cannot do this on the initial form view in a process because there is no list item to store attachments in until the process has started. Hence, attachments have to be uploaded in a workflow action that is not the start node.

In the following example, the user is required to upload at least 1 file but can not upload more than 5. Once the form is routed to the task "Attachment Review," the Workflow Participant must open the attachment and review the contents before their task is considered complete.

In addition, you can also go into the SVConfigurator Tool on the server and write a regular expression to validate against what attachments are attached to the form.

Example: If you would like to only allow files with alphanumeric characters to be uploaded, you would set the key AttachmentControlValidationType to Custom, then set the Key AttachmentControlValidationRegExp to the value of ^[a-zA-Z0-9]+$

*To find other ways to validate strings of text, you may visit RegExLib.com

Known limitations

Back to top

  • Not supported for Autopost or scheduling.
  • Not supported with data review workflow.
  • Only supported for predefined list of T-Codes (see later slide).
  • Maximum file size: 5MB.
  • Not supported in Winshuttle Update workflow plugin
  • In a web form, only one document per attachment control can be uploaded.
  • In a web form, repeated attachment controls are not supported.
  • In a forms-based workflow, document uploads cannot be invoked in the start node/view.
  • Log shows that the upload is successful even if the object (e.g. material) does not exist.