doo.form

It is possible to open an input form in JavaScript. The form does not need to be from the same table as you are in and you can prefill values from the current record.

The usage is pretty wide. You can prefill records in a table based on the currently selected records. Even records from another table.

You can use one of the functions in the doo.form namespace to manipulate with form object:

Functions

  • async openForm(tableNameOrId, options?, applicationId?) 
    It opens an input form for the table (use table name or id). 
    options and applicationId are optional 
    You can use options to prefill the form.

Example #1 - options parameter - opens a new form

{
     model: {
         name: 'Peter',
         position: doo.model.preposition.value
     }
}

 

Example #2 - options parameter - opens an edit form - use id in model

{
     model: {
     	 id: doo.model.customer.value.id,
         position: doo.model.preposition.value
     }
}