# Assistant

## How to Create a Dialog Form

| ### What to do:
| In this example you will learn how these dialogue forms have been created and how they are used to build this specific assistant. The general abbreviation for this assistant is USR, the main LogiView procedures are stored in the logic model EP_ASS. This assistant uses a set of three dialogue forms to prompt for specific data. With this information, the assistant creates: a new DataView user assigns the user to one or more groups and creates an entry in the person and resource table All functions are performed in a database transaction. This ensures the consistency of the database.
| The first dialogue form of the given assistant is used to explain to the usage of the assistant and to prompt for the most significant data (user name and unique user identification code / UIC). The abbreviation for the first step of the assistant is STA (start). According to the naming conventions the name of the dialogue form is EDB-ASS-USR-STA. Two sub-lists are used together with the dialogue form: The second sub-list is EDB-ASS-USR-UIC-SLI and it lists the user identification codes of all existing users. This list is another list on the same entity EDB-BAS-USR-VIEW as used for the first sub-list. The set of buttons is automatically positioned in the lower right corner. Since there is no previous dialogue form, the button < Previous is deactivated, while it is possible to move to the following dialogue form or to abort the assistant. #### Open the first dialog form From the definition of the assistant, the LogiView procedure EP_ASS/USR_STAOpn is executed to open this dialogue form. As you can see from the following listing, the explanation text is defined according to the current language (line 20 and 40). The userexit 'xform_call_dlg' is executed with several arguments (line 60): the name of the main dialogue form (EDB-ASS-USR-STA) is the main argument the two sub-lists (together with the entity name) are set with the option /SELECT the explanation text is set with the option /TEXT Listing of LogiView procedure EDB_ASS/USR_STAOpn
`Line` |  | `Statement`
`10` |  | `if (language() == "GER")`
`20` |  |  | `EP_STRING = "Dieser Assistent hilft Ihnen bei der Neuanlage eines Benutzers. Bitte füllen Sie die nachfolgenden Felder aus. Im unteren Teil sehen Sie die bereits vergebenen Werte."`
`30` |  | `else`
`40` |  |  | `EP_STRING = "This Assistant helps you to define a new user. Please fill in the fields of this form. Below you can see the already used values."`
`50` |  | `endif`
`60` |  | `RES = @ xform_call_dlg (strcat("EDB-ASS-USR-STA /SELECT=EDB-BAS-USER-VIEW EDB-ASS-USR-NAM-SLI, EDB-BAS-USER-VIEW EDB-ASS-USR-UIC-SLI /TEXT=", EP_STRING))`
### Business Application Logic of the first Dialogue Form In this rather simple dialogue form, the only business application logic are two post field userexits. These are implemented as LogiView procedures and check at once, if the entered user name and identification code are unique. ####