FORM OBJECT

Description

The Form is an object that contains other objects.

Specific Properties

In addition to common properties contains the following properties:

  • Comments:
    visible only at design phase, allows information such as the description of the form itself, and change’s history.

Specific events of the form

The main events on the form are:

  • ChangeformEvent: this event is activated when changes the value of any form field. It can be used for example for
    – change the values of one or more fields based on the value entered in a field or more fields.
    – provide the user “warning messages” based on the value entered in a field or more fields.
  • LoadEvent: event activated upon loading of a form (either existing or new).
    It can be used for example to assign values to fields that do not correspond to fields in the database but are the combination of one or more of them (calculated fields).
  • SaveEvent: event activated when you save the form.
    It can be used to validate the data: you can indeed inhibit the save if the inserted data does not respect specific rules that can be placed in the event handling code, which must return a value of false if the save should be inibito.
    For more information about Events click here
    .

Properties that can be used by code

C/S Properties

None

Web properties

None

Methods that can be used by code

  • Alert (“message”)— displays a pop-up window that displays the string passed as parameter
  • GetAssigned (<object>): Returns true if the form object passed as a parameter only accepts values chosen from a list, and the value at the moment is chosen from the list, false otherwise.
  • IsNew (): Returns true if you are creating a new document/form, false if the data is loaded by a document/form previously saved
  • SetAssigned (<object>,<bool>): marks on the object passed in the first parameter as assigned if the second parameter is passed the value true.

Only Form Designer Mobile:

  • AcquirePicture (<postback button>, <type>,<file name>): allows you to take a picture from the camera or from the gallery. The picture will be inserted into linked documents with the specified name.
    In the first parameter it can be passed a “Button object”, whose ClickEvent will be invoked at the picture confirmation. It could also be left to nothing if no postback is required.
    In the second parameter it must be specified the type of the picture:
    1 = Low res picture
    2 = Medium res picture
    3 = High res picture
    4 = Very high res picture
    5 = Get picture from the gallery
    In the third parameter it can be optionally specified the name to be assigned to the picture, that will be shown in the linked document window. It can be left to nothing or empty string.
    Example of use (to be included in the “Click Event code” of a button):

    form.AcquirePicture(form.findcontrol("POSTBACK"),1,"picture")
  • AcquireSignature (<postback button>, <default name>): allows you to capture a handwritten signature by displaying the appropriate mask. The signature will be inserted into linked documents as image in Jpeg format.
    Both parameters could be left to nothing.
    In the first parameter it can be passed a “Button object”, whose ClickEvent will be invoked at the signature’s confirmation time.
    In the second parameter it can be passed the name of the person who will put the signature.
    Example of use (to be included in the “Click Event code” of a button):

    form.AcquireSignature(form.findcontrol("postback"),"Pier Alberto Guidotti")
 

It could also useful to read the following article: