# Assistant

## How to Create the Second 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.
| In the second dialogue form of the given assistant, the user can select one or more groups as listed in the left (source) sub-list and move them to the right (target) sub-list. The main dialogue form does not have any input fields. Check out the definition of the form EDB-ASS-USR-GRP and the both sub-lists EDB-ASS-GRP-NAM-SLIS, EDB-ASS-GRP-NAM-SLIT. Pay attention to the different userexits defined for the two sub-lists. The set of buttons is automatically positioned in the lower right corner and the user can navigate back to the previous dialogue form, to the following one or cancel the assistant. ### Open the second Dialog Form From the definition of the assistant, the LogiView procedure "EP_ASS/USR_GRPOpn" is executed to open this second dialogue form. The first action in this procedure is to get a reference on the assistant top widget, which is a virtual widget with the definition of the currently executed assistant (line 10). With this widget identifier any value that has been entered in any dialogue form so far can be accessed, so for example the entered user name (line 20). According to the current language, this user name is used to define a dynamic explanation text (line 40 and 60). The userexit 'xform_call_dlg' is executed with several arguments (line 80): the name of the main dialogue form (EDB-ASS-USR-GRP) is the main argument the source and the target sub-lists (together with the entity name) are set with the option /SELECT the dynamic explanation text is set with the option /TEXT #### Listing of LogiView procedure EDB_ASS/USR_GRPOpn
`Line` |  | `Statement`
`10` |  | `RES = # xform_get_ass_wdg (EP_ASS_TOP)`
`20` |  | `widget_get_buf(EP_ASS_TOP,"EP_USR_NAM",EP_USR_NAM)`
`30` |  | `if (language() == "GER")`
`40` |  |  | `EP_STRING = strprint ("Wählen Sie die Gruppen aus, denen der Benutzer %s zugeordnet werden soll. Die erste Gruppe ist die Default-Gruppe des Benutzers.", EP_USR_NAM)`
`50` |  | `else`
`60` |  |  | `EP_STRING = strprint ("Select the groups to which the user %s shall be assigned. The first group will be the default-group.", EP_USR_NAM)`
`70` |  | `endif`
`80` |  | `RES = @ xform_call_dlg (strcat("EDB-ASS-USR-GRP /SELECT=EDB-BAS-GROUP-VIEW EDB-ASS-GRP-NAM-SLIS, EDB-BAS-GROUP-VIEW EDB-ASS-GRP-NAM-SLIT /TEXT=", EP_STRING))`
## ### Business Application Logic of the second Dialogue Form The business application logic of the second dialogue form is a single post mask userexit on the target sub-list. Here a LogiView procedure is used to check, if at least one group has been selected (because a user with a group assignment will not be complete). ####