Skip to main content

Components - Notification Box

This Advanced Topic will add information about Support Tickets across the top of the Dashboard.

NOTE: This tutorial is built upon the foundation of the Support Ticket application.

1. Define Ticket Status codebook

  • Type Ctrl + Shift + C; click Codebook
  • Set Name to: Ticket Status
  • Verify that Create Display Attribute is set to: Name
  • Click Finish
  • On the Ticket Status codebook, click Edit Entries
  • Copy and paste the entries from the table below (without table headers)
CodeName
NEWNew
IN_PROGRESSIn Progress
CLOSEDClosed
  • Click OK
  • Save changes: Ctrl + S

2. Update your Ticket entity

  • Go to Data > Entities and double-click Ticket
  • In Data Definition > References, click Add New Reference
  • Set Reference Type to: Codebook
  • Set Target to: TicketStatus
  • Set Please select default values to: NEW
  • Click Create References

3. Go to the Dashboard

  • Go to UI > Dashboard.
  • Open a Dashboard (or create a new one)
  • Go to Simple Components, select Notification Box

4. Establish the Text to be Shown

  • Double-click the Notification Box
  • Set Title to: “Support Tickets:”
  • Content needs to be defined with C#. Here is basic text that can be adjusted as necessary:
(_, db, ctx) => "**New Tickets:** " + db.TicketSet.Count(t => t.TicketStatus == TicketStatus.NEW) +
"\n\n **Tickets In Progress:** " + db.TicketSet.Count(t => t.TicketStatus == TicketStatus.IN_PROGRESS) +
"\n\n **Closed Tickets:** " + db.TicketSet.Count(t => t.TicketStatus == TicketStatus.CLOSED) +
"\n\n " + (db.TicketSet.Any(t => t.TicketStatus != TicketStatus.CLOSED && t.TicketSeverity == TicketSeverity.CRITICAL) ? "**We have some criticial issues!**" : "**There are no critical issues :)**")
  • For Type, select from Simple (grey), Info (blue), Warning (orange), and Error (red).
  • If you would like to add an image, set it in Image. Note: The image needs to have been added in Config > Resources in order to be made available here.