Displaying an Image
The following example
illustrates how to customize the sales order form to allow a user to
upload and display an image of a custom order. In this example, a
customer must be able to place an order for a bike through Enterprise
Portal and upload a sketch of the bike at the same time. An example of a
customer-supplied bike image is shown in Figure 1.
This image must be stored in the database and attached to the sales order line. Sales order lines are stored in the SalesLine table. You could add a new field to the SalesLine
table of the type container and store the image in this field, but this
example uses the document management functionality in Dynamics AX. The
image is therefore stored in the DocuValue table with a reference to a record in the DocuRef table from the image record in DocuValue to the SalesLine record. The relationship and multiplicity among the three tables is shown in Figure 2.
In this example, a document type named Image stores the attached file in the disk folder. The Image document type is shown in Figure 3. The Document Type form is located in the navigation pane, Basic\Setup\Document Management\Document Types.
Any uploaded
image is therefore stored in the document management system; a user can
view the image by either clicking the Document Handling icon on the
status bar or choosing Document Handling on the Command menu. The user
sees the dialog box shown in Figure 4, in which the image can be viewed, modified, or deleted, and additional notes or documents can be attached.