Add A New Person To An Account

The following is an example of the steps necessary to implement a script that adds a new person to an existing account. This is a sophisticated script as it contains examples of populating scrolls and grids as well as using multiple transactions to implement a business process.

Step No Step Type Text Displayed In Script Area Additional Information On The Step
5 Label   Identify the correct account
10 Prompt user Is the existing account currently displayed in the dashboard?

Prompt Type: Button(s)

First Prompt Value - Text: Yes, Next Step: 40

Second Prompt Value - Text: No, Next Step: 20

20 Navigate to a page   Navigation Option: Control Central - Main
30 Set focus to a field

Press <i>Continue</i> after you've selected the customer

(note, see How To Use HTML Tags And Spans In Text for more information about the <i> notation)

Destination Field Name: ENTITY_NAME
40 Move data  

Source Field Type: Predefined Value

Source Field Value: %CONTEXT-ACCOUNTID (note, this is a global variable that contains the ID of the current account)

Destination Field Type: Temporary Storage

Destination Field Name: SAVED_ACCT_ID

50 Conditional Branch  

Compare Field Type: Temporary Storage

Compare Field Name: SAVED_ACCT_ID

Condition: =

Comparison Field Type: Predefined Value

Comparison Field Name: %BLANK

If TRUE, Go To Step: 60

If FALSE, Go To Step: 80

60 Display text

<font color=red>Please select a customer, the dashboard isn't populated with an account</font>

(note, see How To Use HTML Tags And Spans In Text for more information about the <font> notation)

 
70 Go to a step   Next step: 20
80 Display text You will be adding a new customer to account %SAVED_ACCT_ID  
85 Label   Enter the Person's name and primary ID
90 Navigate to a page   Navigation Option: Person -Main (add)
100 Move data  

Source Field Type: Predefined Value

Source Field Value: FALSE

Destination Field Type: Page Data Model

Destination Field Name: ADD_ACCT_SW (Note, this is a switch on Person - Main that a user turns on if they want to both add a person AND an account when they save the new person - we don't want to add an account when we add the new person so we set it to FALSE (i.e., we turn the switch off.)

110 Input data Enter the new person's name in the format "Last Name,First Name" (e.g., Smith,Patricia)

Destination Field Type: User Interface Field

Destination Field Name: PER_NAME:0$ENTITY_NAME

120 Input data Enter the new person's Social Security Number in the format 999-99-9999

Destination Field Type: User Interface Field

Destination Field Name: PER_IDENTIFIER:0$PER_ID_NBR

Note, this step works because the identifier type was defaulted from the installation record and therefore this step only requires the user to enter the person's social security number. Also note, the user doesn't have to enter the SSN in the format shown because this step populates a User Interface Field, which automatically applies the formatting for the respective ID type.

125 Label   Enter one or more phone numbers
130 Prompt user Would you like to define a phone number?

Prompt Type: Button(s)

First Prompt Value - Text: Home Phone (default) Next Step: 140

Second Prompt Value - Text: Business Phone, Next Step: 180

Third Prompt Value - Text: Finished Entering Phone Numbers, Next Step: 220

140 Press a button   Button Name: PER_PHONE:0$pPhones_ADD_BUTTON (note, this causes the add button to be pressed for the first row in the phone grid)
150 Move data  

Source Field Type: Predefined Value

Source Field Value: HOME

Destination Field Type: User Interface Field (Note, we used this data type rather than Page Data Model because we want to trigger the defaulting that takes place when a phone type is selected on the user interface (i.e., the phone format is shown on the page)).

Destination Field Name: PER_PHONE:x$PHONE_TYPE_CD

Note, the "x" notation indicates the current row in the array will be populated.

160 Input data Enter the new person's home phone number in the format (415) 345-2392

Destination Field Type: User Interface Field

Destination Field Name: PER_PHONE:x$PHONE

Note, because a User Interface Field is populated, the default logic associated with this field will be triggered. The default logic for this field formats the input phone number using the algorithm defined on the phone type. This means the user doesn't have to enter the phone number in the designated format, they could enter all numbers and let the system format it.

170 Go to a step   Next step: 130 (this loops to ask them if they want to add another phone number)
180 Press a button   Button Name: PER_PHONE:0$pPhones_ADD_BUTTON (this causes the add button to be pressed for the first row in the phone grid)
190 Move data  

Source Field Type: Predefined Value

Source Field Name: not applicable

Source Field Value: BUSN

Destination Field Type: User Interface Field

Destination Field Name: PER_PHONE:x$PHONE_TYPE_CD (Note, the "x" notation indicates the current row in the array will be populated)

200 Input data Enter the new person's business phone number in the format (415) 345-2392

Destination Field Type: User Interface Field

Destination Field Name: PER_PHONE:x$PHONE

210 Go to a step   Next step: 130 (this loops to ask them if they want to add another phone number)
220 Press a button   Button Name: PER_PHONE:0$pPhones_DEL_BUTTON (Note, this removes the blank row from the person phone grid so we don't get a validation error)
225 Label   Enter the Person's correspondence info
230 Navigate to a page   Navigation Option: Person -Correspondence Info (update)
240 Set focus to a field Press <i>Continue</i> after defining correspondence information for the new person (if any). Don't forget to <font color=red>SAVE</font> the new person (note, see How To Use HTML Tags And Spans In Text for more information about the <i> and <font> notations) Destination Field Name: OVRD_MAIL_NAME1
250 Conditional Branch  

Compare Field Type: Page Data Model

Compare Field Name: PER_ID

Condition: =

Comparison Field Type: Predefined Value

Comparison Field Name: %BLANK

If TRUE, Go To Step: 260

If FALSE, Go To Step: 280

260 Display text <font color=red>The new person hasn't been added, please press the save button to add the new person</font>  
270 Go to a step   Next step: 240
275 Label   Store person, navigate to account page and link to account
280 Move data  

Source Field Type: Page Data Model

Source Field Name: PER_ID

Destination Field Type: Temporary Storage

Destination Field Name: NEW_PERSON_ID

Note, we are saving the person ID as we'll need to populate it on the account / person information later in the script.

290 Move data  

Source Field Type: Temporary Storage

Source Field Name: SAVED_ACCT_ID

Destination Field Type: Page Data Model

Destination Field Name: ACCT_ID

Note, this step is done in anticipation of the following step that transfers the user to the account page. This step simply moves the account ID saved above to some place on the page. The name of the receiving field is important; it must be the same as one of the fields defined on the Navigation Option used to transfer to the destination transaction (this navigation option is defined on the next step). To find the appropriate field name for any transaction, display the navigation option in question.

300 Navigate to a page   Navigation Option: Account - Persons (update)
310 Press a button   Button Name: IM_Sect2_AddButton
320 Move data  

Source Field Type: Temporary Storage

Source Field Name: NEW_PERSON_ID

Destination Field Type: User Interface Field

Destination Field Name: ACCT_PER$PER_ID

330 Set focus to a field Press <i>Continue</i> after defining the new person's relationship type. Don't forget to <font color=red>SAVE</font> the changes to the account Destination Field Name: ACCT_PER$ACCT_REL_TYPE_CD
340 Move data  

Source Field Type: Predefined Value

Source Field Name: %SAVE-REQUIRED

Destination Field Type: Temporary Storage

Destination Field Name: SAVE_NEEDED

350 Conditional Branch  

Compare Field Type: Temporary Storage

Compare Field Name: SAVE_NEEDED

Condition: =

Comparison Field Type: Predefined Value

Comparison Field Name: FALSE

If TRUE, Go To Step: 380

If FALSE, Go To Step: 360

360 Set focus to a field <font color=red>You have not saved this information!</font> Press <i>Continue</i> after saving.

Destination Field Name: IM_SAVE

(note, this positions the cursor on the save button)

370 Go to a step   Next step: 340
380 Display text Script complete  
390 Height  

Script Window Height: 0

Height Unit: Pixels

Note the following about this script: