Implementation of quote attachments
You can attach a document to a quote to keep track of extra information, such as emails.
A Field Sales Representative (FSR) may want to attach files to quotes. For example, the requirements of the customer might have been e-mailed to the FSR as a Microsoft Office Word document, and the FSR may want to attach the document to the quote, while creating the quote.
Solution
Sterling Field Sales allows users to upload attachments to quotes. Users can also delete existing attachments.
The
user can use the Manage Attachments related task to add or delete
existing attachments. The getCompleteOrderDetails
API
is called to retrieve the details of the quote to be displayed in
the Manage Attachments screen.
Users can add attachments, by
clicking the Add button. The New
Attachment dialog box is displayed and the
scfileuploadwidget
is
used to upload the files. The files are uploaded using the following
widgets:- When the user browses and selects a file the
sc.file.upload.type
widget is set toONSELECT
. When a single file is, or multiple files, are selected, a multipart request stores the file temporarily on the server. - After selecting one or more files to be uploaded, when the user
clicks the Save button, the
sc.file.upload.type
widget is set toONSUBMIT
and the files are saved as attachments for the quote. ThechangeOrder
API transfers the files from the temporary location on the server to the database. - After the files are attached to the quote, the details of the file attachment such as the file name, file description, file content type, and the file size are displayed in the UI. The value of the file type is fetched from the common codes.
- The file attachment API output returns an internet mime type. This internet mime type is mapped with the common codes to generate the value of the file type.
FileAttachments
element
with file information, such as a unique File ID, File location and
Widget ID is uploaded on the server. The New Attachment dialog
box is closed, and the Attachments panel of
the Manage Attachments screen is refreshed to display the newly added
attachment.When the user clicks the Delete button
on the Manage Attachments screen, the selected attachments are removed
from the quote using the
changeOrder
API.Note: Multiple
attachments can be deleted at the same time.
The user can download
previously uploaded attachments. If the user clicks the link on the Name of
the attachment, the file download option that is displayed, prompts
the user to open or save the attachment.Implementation
This section explains the
configurations for this feature:
- You can configure the directory where the attachments are temporarily stored.Note: The temporary file location should not be the same as the application server location.
- You can customize Sterling Field Sales to add files with file extensions, which are not
provided, by default. You must override the properties specified in the
customeroverride.properties
file. - You must add the
yfs.sc.file.upload.dir
property with the value as/omscommonfile/fileupload
by using the System Administration Console. For more information, see Managing properties in the database using the System Administration Console. - You can configure the application to encode or decode the files being attached to Sterling Field
Sales. A new interface,
IFileEncoderDecoder
, is provided to encode the file content before it is streamed to the temporary file. - You can configure the application to enable virus scan on the file being attached to Sterling
Field Sales. A hook is provided using which Sterling Field Sales can plug- in the logic to
scan the file being uploaded for viruses. The
sc.file.upload.virus.scanner
property should be provided inyfs.properties
file.IVirusScanner
is the newly added interface which enables virus scans. - You can configure the secure delete feature that is available in Sterling Field Sales, by
default. A new interface,
ISecureFileDelete
is provided that performs a secure delete of the files placed in the temporary location.