(16) Components – Attachments
- Support Ticket Tutorial -
This Advanced Topic will enable the end user to attach a screenshot or a document to a Support Ticket. It is similar to how Ticket Notes were established. This will put the list of attachments at the bottom of the Detail Page in a Document List.
1. Create a Ticket Attachment Entity
This step will create a new entity named “Ticket Attachment”. The Composition reference type (1 -> N) will be used.
- Create a Ticket entity. Type:
Ctrl + Shift + Cto open the general Create Dialogue; select Entity. Nameyour Entity: Ticket Attachment- Set the
Display Icon. (Suggestion: Use “Paperclip”.) - Change the
Create Display Attributeto Title. This will create an attribute and set it as the display expression for entity records. - Click
Next. - Inside the Create Pages box, keep the Create Page and Detail Page; un-select the List Page.
- Click
Finish - Save Changes:
Ctrl + S
2. Add Attributes to the Ticket Attachment Entity
- In the Data Definition > Attributes section, click
Add Attribute - Set
Attribute Nameto: Attachment - Set
Typeto: Document (move into the data-box and type “c”) - Click
Save
— - Go to the Settings tab, click
Inherited Aspects - Select TimeStamp
- Save changes: Ctrl + S
3. Set References
- In the Data > Entities subsection, double-click the Ticket entity
- In the Data Definition > References section, click the
Add Reference - Set
Nameto: Ticket Attachment. - Set the
Typeto: Composition. - Set
Referencedto: Ticket Attachment. - Click
Save. - Save Changes:
Ctrl + S
4. Update User Interface
Go to UI > Entity Pages and double-click on the pages below to update them with the Ticket Attachment attribute.
A. TicketAttachment Create Page
- Click
Add View. Then, clickCreate Empty View for Ticket Attachment - In the layout editor add Data Fields. Click Title, Ticket and Attachment
— - Define the Attachment expression further. Click
Attachment - In the Validations Section, click the
Magic Wand. Select **Require attached document ** - Click
OK - Click
OK
—
Set the Layout so that it can be Shared on the Detail Page - In the Layout section, click
More - Click
Make Shared - Click
Ctrl + S
B. TicketAttachment Detail Page
- In the center of the page, click
Add View - Then click
Add Shared View for Entity Ticket Attachment - Save changes:
Ctrl + S
5. Update Ticket Detail Page
- Go to UI > Entity Pages and click Ticket Detail
- Go the Layout section. Near the bottom of the page, click
Add Tab - Set
Labelto: Attachments - Set
Tab Icon, if necessary (Suggestion: Use “Paperclip”.) - Click
OK - In the tab area, select the
Attachmentstab. - Click
Add View. Then clickCreate Empty View for Ticket - In the side bar, locate
Advanced Componentsand select: Document List - Click
Configure Document List - Set
Item Entityto: TicketAttachment - Set
Document Attributeto: Attachment - Set
User Attributeto: CreatedBy - Set
Created Attributeto: CreatedDate - Set
Parent Entity Referenceto: Ticket - Click
OK - Click
OK - Save:
Ctrl + S