Dismissible dialogs and save preferences

In order to design user-friendly systems that can be used intuitively, we need to store the user's preferences, and allow them to specify them at runtime.

Dismissible dialogs and save preferences

Each user can make their own settings, based on the level of guidance they feel comfortable with.

This pattern is relatively new to the Microsoft Dynamics NAV product, and was first implemented in the 2013 R2 version.

Note

An explanation of the implementation of embedding instructions in Microsoft Dynamics NAV is available at https://www.youtube.com/watch?v=loobQ1TVO3o&list=PLhZ3P-LY7CqmVszuvtJLujFyHpsVN0U_w&index=14.

Technical description

The preferences are stored in a table with a combination of User ID and a code that represents the setting. The settings are handled in functions that are the members of the function.

To test if a user has not disabled something, simply use the following code:

IsGettingStartedVisible() : Boolean
EXIT(NOT MiniUserRemovedInstructions.GET(USERID,GetGettingStartedCode));

If a user wants to disable a feature, the DisableInstruction function can be used:

DisableInstruction(InstrCode : Code[20])
IF NOT MiniUserRemovedInstructions.GET(USERID,InstrCode) THEN BEGIN
  MiniUserRemovedInstructions.INIT;
  MiniUserRemovedInstructions."User ID" := USERID;
  MiniUserRemovedInstructions."Instruction Code" := InstrCode;
  MiniUserRemovedInstructions.INSERT;
END;

Dismissible dialog

To allow a user to dismiss a message, a STRMENU should be implemented as the following:

ShowCreateLineInstruction(ItemNo : Code[20])
IF (ItemNo = '') AND GUIALLOWED AND IsEnabled THEN
  IF STRMENU(OptionsStringQst,1,CreateNewLineInstructionTxt) = 2 THEN
    DisableMessageForCurrentUser;

The OptionsStringQst is a Text Constant with the Show this instruction again and Do not show again options.

Implementations

This pattern is implemented in some areas of the Small Business Application.

Note

I've explain what the Small Business Application is about at the http://nav-skills.com/2013/09/26/dynamics-c5-2014-welcome-miniapp/ blog entry.

Examples

Object

Description

Table 1306

Mini User Removed Instructions

Page 9022

Small Business Role Center

Codeunit 1320

Mini Lines Instruction Mgt.

Codeunit 1321

Mini Getting Started Mgt.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.189.157