Dela via


Creating Checklists

Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

Checklists can be used during setup and upgrade. The checklist concept provides a tool for adding items that must be part of a specific setup procedure.

Creating a New Checklist

  1. Create a new class that inherits from the SysCheckList class. For an example of methods that can be overridden, see the SysCheckList_Setup class.

  2. Create a new empty interface. The interface is used by items that belong to the checklist.

  3. Add the classId to the SysCheckList::checkLists static method.

  4. Create the necessary checklist items and add them to your checklist.

Adding Items to a Checklist

  1. Create a new class that inherits from SysCheckListItem class.

  2. Override the following methods:

  3. Set the security key for the menu items to limit access to certain users based on user permissions, by using the Menu.securityKey method.

  4. Add a dependency for a menu item by using the SysCheckListItem.addDependency method.

  5. Run the following code when the checklist tasks are completed.

        SysCheckList::finished(classnum(SysCheckListItem_MyNewItem))
  1. Add the ID for the class you created in step 1 to the ::checkListItems static method.

  2. 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 depends 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)} ); 

See also

Upgrading to a New Version of Microsoft Dynamics AX

Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.