Develop > Tailoring > Form creation > Forms Designer > Creating and editing forms > Referencing images in the XML for the graph control

Referencing images in the XML for the graph control

When you are building an application that includes a graph diagram, you can reference an image that is attached to a record in Service Manager. The graph uses the attached image to display the icon for that node. You can also display portrait icons that are attached to contact records in the graph diagram.

This is an example of a schema definition for an icon.

XML Icon

The syntax to reference an image from the database and display it in the graph is:

scattach://{type}:{uid}:{attachmentname}:{table}:{record}, where type equals ‘img’ or ‘file’.

The unique identifier for each image is located on the corresponding SYSATTACHMENTS record.

The following is an example of how to reference an image that is an attachment to a record.

scattach://file:45c0dfd600245044034b76c8:max_manager_small.gif:contacts:MANAGER, MAX

The following is an example of how to reference a portrait image on a contacts record.

scattach://img:45afb84a002d42c403030d48:MANAGER, MAX:contacts:MANAGER, MAX

Here is an example of a complete and valid XML statement that references an image. This particular statement references an image that is attached to Max Manager's contacts record. This displays as an icon for the node in the graph diagram.

Icon XML

Icons with larger position values appear on top of smaller position values unless the images specify the same value for the position attribute. In that case, the icons are rendered in document order so that icons later in the document for the same node overlay those preceding them. The origin for all icons is the center. When you specify a group attribute for an icon, it includes items that contain duplicate group attributes.

Related concepts

Building a graph diagram
Components of the graph
Defining actions on nodes and edges in the XML for the graph control
Defining the graph in XML format
W3C schema for graph diagram XML
Valid values for graph elements and attributes
Graph toolbar icons

Related tasks

Activate an action on a node or edge in a graph
Set the focus on the graph

Related references

Graph control