Skip to content

sc-approve

sc-approve-field-Example-1-Image-2

1 Purpose

sc-approve places an approve field in the form of a checkbox on a form. Ticking the checkbox indicates approval and will display the approver's name and account beside the ticked checkbox. The sc-approve field is only enabled for those users who have the specific key associated with it.

The sc-approve definition provides fields for setting the properties of an approve field and is fully described below.

 

2 Definition

sc-approve is defined by a set of name/value pair fields consisting of:

  • Required system fields
  • Required customizable fields
  • Optional customizable fields

Note:

  1. Default values for fields described in the tables below are shown in bold text.

2.1 Required System Fields

Field Valid Values Description
componentName sc-approve The component name.
Example: "componentName": "sc-approve"

2.2 Required Customizable Fields

Field Valid Values Description
keyIds Array of keys ids An array of one or more key ids.
A user must have at least one of these keyIds in order to access the sc-approve field.
Example:
"keyIds": [
    "de00fcb0-84af-11e8-82c8-778f0f89c2be"
]
name Any value written in camel case. Defines the name of the approve field in the document and database.
Example: "name": "testScApprove"

2.3 Optional Customizable Fields

Field Valid Values Description
disableSave true Ticking the approve field does not trigger the Save icon to flash.
Exiting the form without saving the ticked approve field does not trigger a warning message to display.
Example: "disableSave": true
false Default value. Ticking the approve field does trigger the Save icon to flash.
Exiting the form without saving the ticked approve field does trigger a warning message to display.
enabled false The approve field is greyed out.
A Stop icon appears on mouseover.
The approve field cannot be ticked.
Example: "enabled": false
true Default value. The approve field can be ticked.
fullWidth true The approve field displays full width on the form.
Example: "fullWidth": true
false Default value. The approve field does not display full width on the form.
label Any value Defines the name of the approve field on the form i.e. the field label.
Example: "label": "Test sc-approve"
"name" field value Defaults to the value defined for the 'name' field, with its first letter displayed in upper case and any imbedded upper case letters displayed in lower case prefixed with an underscore.
Example: "Test_sc_approve" is the default value if the "name" field value was "testScApprove".
mandatory true The approve field displays as mandatory (i.e. label in red text with an asterisk).
Saving without ticking the approve field, a message prompts the user to enter a value for the approve field.
Example: "mandatory": true
false Default value. The field displays as optional (i.e. label in black text).
visible false The approve field is not visible on the form.
Example: "visible": false
true Default value. The approve field is visible on the form.

 

3 Typical sc-approve Definition

Below is a typical sc-approve definition, defined with its required fields plus any optional field whose value is typically other than its default value.

 

{
    "name": "allChecked",
    "keyIds": ["3e88afa0-5e50-11e8-baa9-a9d161e55a91"],
    "label": "Lodged By",
    "mandatory": true,
    "componentName": "sc-approve"
}

 

One or more of the optional fields shown below can be included in the above definition should a value other than their default value be required.

    "disableSave":true,
    "enabled":false,
    "fullWidth":true,
    "visible":false,
    "defaultValue":true,

 

4 Examples

Example 1:

A typical sc-approve definition, defined with its required fields plus any optional field whose value is typically other than its default value.

 

        {
            "componentName": "sc-approve",
            "name": "testScApprove",
            "label": "Test sc-approve",
            "keyIds": [
                "de00fcb0-84af-11e8-82c8-778f0f89c2be"
            ],
            "mandatory": true
        }

 

Resulting field on the form:

sc-approve-field-Example-1-Image-1

Resulting field on the form after ticking the approve field:

sc-approve-field-Example-1-Image-2

Resulting field in the document and database:

"testScApprove": {
    "approveAccount": {
        "documentId": "b7c1e1b0-2b9f-11e6-ac9c-170c531a5a0c",
        "name": "User Account - barry.eadie@fieldtec.com - barry.eadie@fieldtec.com"
    },
    "approveDate": "2018-07-11T02:50:24.315Z"
}