Create Checklist Items
-
Create a new class that inherits from SysCheckListItem class.
-
Implement an interface for a setup checklist by using the SysCheckListInterfaceSetup class, or implement an interface for an upgrade checklist by using the SysCheckListInterfaceUpgrade class.
-
Override the following methods:
-
Set the security key for the menu items to limit access to certain users based on user permissions, by using the Menu::securityKey method.
-
Add a dependency for a menu item by using the SysCheckListItem::addDependency method.
-
Run the following code when the check list tasks are completed.
SysCheckList::finished(classnum(SysCheckListItem_MyNewItem))
-
Add the ID for the class you created in step 1 to the SysCheckList:checklistItems static method.
-
If a menu item requires restarting the system, call SysCheckList::needRestart in the SysCheckListItem::setStatus method as shown in the following example.
if (status == SysCheckListStatus::finished && !this.find()) { this.save(); SysCheckList.needRestart(true); }
The following code shows a call to the SysCheckListItem::placeAfter method that sets the sequence in the list and a call to the SysCheckListItem::indeterminate method that indicates that a menu item can be skipped. When a user clicks the item, the status changes to finished.
The placeAfter method is dependent on the SysCheckList::sortWithStatusPreference method.
super(); this.indeterminate(true); // You can skip this item this.placeAfter(classnum(SysCheckListItem_Synchronize)); // Can only run after sync this.addDependency(classnum(SysCheckListItem_Synchronize)); // Can only run after compile or licensecode this.addDependency( [classnum(SysCheckListItem_Compile), classnum(SysCheckListItem_LicenseCode)} );