Méthodes

Lors de l’exécution du script par le client, certaines méthodes sont appelées en fonction du contexte d’exécution. Cette page décrit les différentes méthodes disponible et leur contexte d’appel.

OnOpenTask :
{
    return
}
//--------------------------------------------------------------
OnPrepareNewEntry :
{
    return
}
//--------------------------------------------------------------
OnNewEntry :
{
    return
}
//--------------------------------------------------------------
OnModifyEntry :
{
    return
}

The next table presents the functions that are taken into account automatically by the rich client. These functions are called on specific events or/and if the configuration specifies the

OnOpenTask

This function is called when a task is launched, before clicking on any record

OnTaskLoaded

This function is called when the task has been completely loaded

OnDeletePage

This function is called when a page is deleted

OnRun

This function is called when list/processing treatment is launched

OnContinue

This function is called the user clicks on the continue button after list/processing treatment ended

OnModifyPage

This function is called before the server processing when a page is validated with modifications

OnAfterModifyPage

This function is called after the server processing when a new page is successfully modified.

The following extra variables are available

  • CURRENT_DATAPAGE_ID : The datapage of the newly created page
  • CURRENT_DATAPAGE_OCCURRENCE : The occurrence of this new page.

OnPrepareNewPage

This function is called when a page is created. It allows for example to initialize fields

OnReadPage

This function is called when an existing page is selected

OnNewPage

This function is called before the server processing when a new page is created. It allows for example to initialize fields

OnAfterAddPage

This function is called after the server processing when a new page is successfully created. It allows for example to imediately create a new page.

The following extra variables are available

  • CURRENT_DATAPAGE_ID : The datapage of the newly created page
  • CURRENT_DATAPAGE_OCCURRENCE : The occurrence of this new page.

OnBeforeReadEntry

This function is called before the server processing when the user clicks on an entry in the navigator/subnavigator

OnReadEntry

This function is called after the server processing when the user clicks on an entry in the navigator/subnavigator

OnDeleteEntry

This function is called before the server processing when the user deletes an entry of the navigator/subnavigator

OnModifyEntry

This function is called before the server processing when the user validates an entry with modifications

OnAfterModifyEntry

This function is called after the server processing when the user validates an entry with modifications

OnNewEntry

This function is called the first time the user validates an entry (when he creates it)

OnAfterNewEntry

This function is called after the server processing when the user creates a new Entry

OnExitTask

This function is called when the task is closed

OnAfterScreenPaste

This function is called when the user xml copy/paste a screen

OnPrepareNewEntry

This function is called when a new entry is beeing prepared so that the system can pre-fill fields for example

OnFieldChange

This function is called when a field with the property ScriptOnValidate=“true” is modified by the user.

OnFieldNoteChange

This function is called when the user modifies a note associated with a field with the property ScriptOnNoteValidate=“true”. The following variables will be available :

  • CURRENT_FIELD_ID : The field on which the user changed the note
  • CURRENT_DATAFIELD_ID : The datafield on which the user changed the note
  • NOTE_CURRENT_TEXT : The text of the note
  • NOTE_NB_IMAGES : The number of images in the note
  • NOTE_NB_SOUNDS : The number of sounds in the note
  • NOTE_NB_FILELINKS : The number of files linked in the note

OnCancel

This function is called when the user cancels the modifications in the client.$

OnFileDropped

This function is called once for each file when the user drops files on the task. This call is performed only if the task allows it (see Task Configuration).

The following extra variables are available

  • DROPPED_FILE_PATH : Absolute path to the file on disk
  • DROPPED_FILE_IS_LAST : When dropping multiple files, this variable will be true when the last file will be dropped. This allows to refresh a view for example only after the last treatment.

OnOutlookFileDropped

This function is called once for each Mail file when the user drops mails from Outlook (may not work on Outlook Express). This call is performed only if the task allows it (see Task Configuration).

The following extra variables are available

  • DROPPED_FILE_PATH : Absolute path to the msg file on disk
  • DROPPED_FILE_IS_LAST : When dropping multiple files, this variable will be true when the last file will be dropped. This allows to refresh a view for example only after the last treatment.
  • DROPPED_FILE_FROM : The sender name of the mail
  • DROPPED_FILE_SUBJECT : The subject of the mail
  • DROPPED_FILE_RECEIVED_DATE : The date of reception of the mail
  • DROPPED_FILE_SIZE : The human readable size of the mail (i.e. 980 K)
  • DROPPED_FILE_CATEGORY : The category of the mail

OnBeforeSuperTaskChildTap

This function is called when the user taps on a supertask tab, before it has been loaded.

The following extra variables are available

  • SUPERTASK_TAPPEDTASK_ID : The id of the task the user switched to
  • SUPERTASK_ID : The ID of the supertask.
  • SUPERTASK_MAINTASK_ID : The ID of the first task of the supertask. This could not be a main task as main task do not appear in supertask type 1, but this will be usefull in any case
  • SUPERTASK_TAPPEDTASK_FIRST_TIME : If it’s the first time the user clicks on the tab. One important thing to know is that calling cancelCurrentProcess() in the script in the before event will stop the system from switching and will switch back to previous task.

OnAfterSuperTaskChildTap

This function is called when the user taps on a supertask tab, after it has been loaded.

The following extra variables are available

  • SUPERTASK_TAPPEDTASK_ID : The id of the task the user switched to
  • SUPERTASK_ID : The ID of the supertask.
  • SUPERTASK_MAINTASK_ID : The ID of the first task of the supertask. This could not be a main task as main task do not appear in supertask type 1, but this will be usefull in any case

OnBeforeNewPageListDisplay

This function is called when the users clicks on the new page button. This script has access to the dossier values and can use the function removeThemeFromNewPageList(<theme_id>) and removePageFromNewPageList(<datapage_id>) to hide the irrelevant pages/themes based on the dossier state. This allows to guide the user. |