Skip to content

sc-party

 

1 Purpose

sc-party places a party field on a form, allowing the user to enter a person's details (title, first name and surname).

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

 

2 Definition

sc-party 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-party The component name.
Example: "componentName": "sc-party"

2.2 Required Customizable Fields

Field Valid Values Description
name Any value written in camel case. Defines the name of the party field in the document and database.
Example: "name": "testScParty"

2.3 Optional Customizable Fields

Field Valid Values Description
disableSave true Entering values in the party field does not trigger the Save icon to flash.
Exiting the form without saving the entered value does not trigger a warning message to display.
Example: "disableSave": true
false Default value. Entering values in the party fields does trigger the Save icon to flash.
Exiting the form without saving the entered value does trigger a warning message to display.
dropDownList Array of titles Lists the title values for the Party Title drop down field.
Example: "dropDownList": ["Mr","Mrs","Miss"]
Example:
"dropDownList": [
    "Mr",
    "Mrs",
    "Miss"
]
Defaults to:
"dropDownList": [
    "Mr",
    "Mrs",
    "Miss",
    "Ms",
    "Dr"
]
enabled false The party field is greyed out.
A Stop icon appears on mouseover.
A value cannot be entered in the party field.
Example: "enabled": false
true Default value. Values can be entered in the party field.
fullWidth true The party field displays full width on the form.
Example: "fullWidth": true
false Default value. The party field does not display full width on the form.
mandatory true The party field displays as mandatory (i.e. label in red text with an asterisk).
Saving without a value, a message prompts the user to enter a value for the party field.
Example: "mandatory": true
false Default value. The party field displays as optional (i.e. label in black text).
label Any value Defines the name of the party field on the form i.e. the field label.
Example: "label": "Test sc-party"
"name" field value Defaults to the value defined for the "name" field, with the first letter displayed in upper case and any upper case letters displayed in lower case prefixed with an underscore.
Example: "Test_sc_party" is the default value if the "name" field value was "testScParty".
mandatoryFields Array of party fields Lists which Party fields are mandatory when the "mandatory" field is set to "true".
Saving without entering a value, a message prompts the user to enter a value for the party field.
Example:
"mandatoryFields": [
    "firstName",
    "surname"
]
["title","firstName","surname"] Default value when the "mandatory" field is set to "true".
Note:: If "mandatory" is set to false, then no mandatory checks are enforced, regardless of the "MandatoryFields" value.
visible false The party field is not visible on the form.
Example:"visible": false
true Default value. The party field is visible on the form.

 

3 Typical sc-party Definition

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

{
      "componentName": "sc-party",
      "label": "Test sc-party Component",
      "name": "testScPartyComponent",
      "fullWidth":true
}

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.

    "mandatory": true,
    "mandatoryFields": [
       "firstName",
       "surname",
    ],
    "dropDownList": [
       "Mr",
       "Mrs",
       "Miss"
    ],
    "disableSave":true,
    "enabled":false,
    "visible":false

 

4 Examples

Example 1

sc-party with only its required system fields and required customizable fields defined.

{
      "componentName": "sc-party",
      "label": "Test sc-party Component",
      "name": "testScPartyComponent"
}

Resulting field on the form:

alt text

Resulting field on the form after entered data:

alt text

Resulting field in the document and database:

    "testScPartyComponent": {
        "title": "Mr",
        "firstName": "John",
        "surname": "Smith"
     }

Example 2

sc-party with its required fields and three optional fields ("mandatory", "mandatoryFields", "dropDownList") defined.

{
    "componentName": "sc-party",
      "label": "Test sc-party Component",
      "name": "testScPartyComponent",
      "mandatory": true,
      "mandatoryFields": [
               "firstName",
               "surname"
        ],
      "dropDownList": [
               "Mr",
               "Mrs",
               "Miss"
        ]
}

Resulting field on the form:

alt text