/

 

The manual

Self-training

Experimentation

Contact

 

Language

Prefill a field of a form

Suppose that the page where we are going to add a new invoice already contains a contact card that indicates the customer's code (as a reminder, the screenshots below were taken in organize mode which shows the name of each one in light gray. field):

To automatically pre-fill the 'customer' field of the new invoice card, it is sufficient that this contains a program with the following code:

if client=""
  each_form type "contact"
    field Str client -> client1
    client := client1

Notice the line:

    field Str client -> client1

It indicates that the contact card must contain a customer field, but that in the program it will be designated by the word 'customer1' because the word 'customer' already designates the customer field of the invoice card.

The result obtained when you paste an invoice form taken from the models part of the site is then:

Bill

Date :

Client : mobilis

Item

Amount

Unit price

Price

 

 

Total: