Interface Definition: Expression evaluation error [evaluation ID = NMYPA] : An error occurred while executing a save: Expression evaluation error: You must specify a variable to save into, such as ri!name << fn!sum. Received: Record Field.

Certified Associate Developer

a!localVariables(
  local!currentStep: 1,
  local!addressdifference,
  a!cardLayout(
    contents: {
      a!milestoneField(
        label: "Milestone",
        labelPosition: "ABOVE",
        steps: {
          "Basic Details",
          "KYC Requirement",
          "TIN",
          "Documents",
          "Preview"
        },
        links: {},
        active: local!currentStep
      ),
      a!sectionLayout(
        contents: {
          a!boxLayout(
            label: "Applicant Basic Details",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!dropdownField(
                        choiceLabels: cons!B_non_Titled_choiceLabels,
                        choiceValues: cons!B_non_Titled_choiceLabels,
                        label: "Non-Titled Type",
                        labelPosition: "ABOVE",
                        placeholder: "--- Select a Value ---",
                        value: ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{dc6c7bc3-7eee-4315-9bfc-a23e5668fb83}nonTitledType'],
                        saveInto: ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{dc6c7bc3-7eee-4315-9bfc-a23e5668fb83}nonTitledType'],
                        searchDisplay: "AUTO",
                        showWhen: contains({ 1, 5 }, local!currentStep),
                        required: true(),
                        disabled: contains({ 5 }, local!currentStep),
                        validations: {}
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Full Customer Name",
                        labelPosition: "ABOVE",
                        value: ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{8b20734f-ee44-41b5-9ec9-3c043270a661}customerName'],
                        saveInto: ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{8b20734f-ee44-41b5-9ec9-3c043270a661}customerName'],
                        refreshAfter: "UNFOCUS",
                        showWhen: contains({ 1, 5 }, local!currentStep),
                        required: true,
                        disabled: contains({ 5 }, local!currentStep),
                        validations: {}
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Contact Number",
                        labelPosition: "ABOVE",
                        value: ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{2bc57c91-54c5-4236-a1ae-26634fee94c2}contactNumber'],
                        saveInto: ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{2bc57c91-54c5-4236-a1ae-26634fee94c2}contactNumber'],
                        refreshAfter: "UNFOCUS",
                        showWhen: contains({ 1, 5 }, local!currentStep),
                        required: true,
                        disabled: contains({ 5 }, local!currentStep),
                        validations: {
                          if(
                            a!isNullOrEmpty(
                              ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{2bc57c91-54c5-4236-a1ae-26634fee94c2}contactNumber']
                            ),
                            {},
                            if(
                              a!isPhoneNumber(
                                phoneNumber: ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{2bc57c91-54c5-4236-a1ae-26634fee94c2}contactNumber'],
                                countryCode: "AU"
                              ),
                              {},
                              "Please enter valid phone number."
                            )
                          )
                        }
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Email",
                        labelPosition: "ABOVE",
                        value: ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{87b369a0-06b4-41b1-a3ae-55c4bca74be4}email'],
                        saveInto: ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{87b369a0-06b4-41b1-a3ae-55c4bca74be4}email'],
                        refreshAfter: "UNFOCUS",
                        showWhen: contains({ 1, 5 }, local!currentStep),
                        required: true,
                        disabled: contains({ 5 }, local!currentStep),
                        validations: {}
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Occupation",
                        labelPosition: "ABOVE",
                        value: ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{4b8fd621-7e45-436f-9e78-da999a363828}occupation'],
                        saveInto: ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{4b8fd621-7e45-436f-9e78-da999a363828}occupation'],
                        refreshAfter: "UNFOCUS",
                        showWhen: contains({ 1, 5 }, local!currentStep),
                        required: true,
                        disabled: contains({ 5 }, local!currentStep),
                        validations: {}
                      )
                    }
                  )
                }
              ),
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!dropdownField(
                        choiceLabels: cons!B_Branch_choicLable,
                        choiceValues: cons!B_Branch_choicLable,
                        label: "Branch",
                        labelPosition: "ABOVE",
                        placeholder: "--- Select a Value ---",
                        value: ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{f7e34f4c-f97c-4396-b1ee-3d1d0de7077e}branch'],
                        saveInto: ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{f7e34f4c-f97c-4396-b1ee-3d1d0de7077e}branch'],
                        searchDisplay: "AUTO",
                        showWhen: contains({ 1, 5 }, local!currentStep),
                        required: true,
                        disabled: contains({ 5 }, local!currentStep),
                        validations: {}
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!dateField(
                        label: "Date of Birth",
                        labelPosition: "ABOVE",
                        value: ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{4d29b199-1250-4146-bf25-ed66d90b0420}dateOfBirth'],
                        saveInto: ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{4d29b199-1250-4146-bf25-ed66d90b0420}dateOfBirth'],
                        showWhen: contains({ 1, 5 }, local!currentStep),
                        required: true,
                        disabled: contains({ 5 }, local!currentStep),
                        validations: {}
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!checkboxField(
                        choiceLabels: { "Cards", "eBanking" },
                        choiceValues: { "Cards", "eBanking" },
                        label: "Request services",
                        labelPosition: "ABOVE",
                        value: if(
                          isnull(
                            ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{855ca064-62fb-4338-a730-0b2bfeecd1b7}servicesRequest']
                          ),
                          {},
                          split(
                            ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{855ca064-62fb-4338-a730-0b2bfeecd1b7}servicesRequest'],
                            "#"
                          )
                        ),
                        saveInto:
                        a!save(
                          ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{855ca064-62fb-4338-a730-0b2bfeecd1b7}servicesRequest'],
                          if(
                            isnull(save!value),
                            save!value,
                            joinarray(save!value, "#")
                          )
                        ),
                        showWhen: contains({ 1, 5 }, local!currentStep),
                        required: true,
                        disabled: contains({ 5 }, local!currentStep),
                        validations: {}
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!radioButtonField(
                        choiceLabels: { "Titled Member", "Non- Titled Member" },
                        choiceValues: { "Titled Member", "Non- Titled Member" },
                        label: "Member Type",
                        labelPosition: "ABOVE",
                        value: ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{a6ed9510-47ae-47b4-a153-66461edb0253}member'],
                        saveInto: ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{a6ed9510-47ae-47b4-a153-66461edb0253}member'],
                        
                        showWhen: contains({ 1, 5 }, local!currentStep),
                        required: true,
                        disabled: contains({ 5 }, local!currentStep),
                        choiceLayout: "STACKED",
                        validations: {}
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!radioButtonField(
                        choiceLabels: { "Male", "Female" },
                        choiceValues: { "Male", "Female" },
                        label: "Gender",
                        labelPosition: "ABOVE",
                        value: ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{b339bf98-a9e4-4db5-b3dd-4c6c9107dc61}gender'],
                        saveInto: ri!customerDetails['recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{b339bf98-a9e4-4db5-b3dd-4c6c9107dc61}gender'],
                        showWhen: contains({ 1, 5 }, local!currentStep),
                        required: true,
                        disabled: contains({ 5 }, local!currentStep),
                        choiceLayout: "STACKED",
                        validations: {}
                      )
                    }
                  )
                }
              )
            },
            showWhen: (contains({ 1, 5 }, local!currentStep)),
            style: "STANDARD",
            marginBelow: "STANDARD"
          ),
          a!boxLayout(
            label: "KYC Requirement",
            contents: {
              a!richTextDisplayField(
                value: a!richTextIcon(
                  icon: "refresh",
                  link: a!dynamicLink(
                    saveInto: {
                      a!save(
                        target: local!addressdifference,
                        value: {}
                      ),
                      a!save(
                        ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{4176186e-67dc-4165-9e81-2ec0c7201bb8}PADoorNumber'],
                        {}
                      ),
                      a!save(
                        ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{b32c00ac-7f72-47e4-a4e7-e2951de12be8}PAStreet'],
                        {}
                      ),
                      a!save(
                        ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{a87a8af2-72b0-4f82-b158-df7b59a41300}PACity'],
                        {}
                      ),
                      a!save(
                        ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{db9413ba-d29f-4a2b-88a6-eba5ad17da88}PAState'],
                        {}
                      ),
                      a!save(
                        ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{8ae3a84f-ff88-4248-9b50-467bdcaee8e4}PACountry'],
                        {}
                      ),
                      a!save(
                        ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{96d15b43-a320-4d68-80cd-f2e4a37bbd1d}PAPostCode'],
                        {}
                      )
                    }
                  ),
                  showWhen: tointeger(local!addressdifference) = 2
                ),
                align: "RIGHT"
              ),
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!cardLayout(
                        contents: {
                          a!richTextDisplayField(
                            labelPosition: "COLLAPSED",
                            value: {
                              a!richTextHeader(text: { "Residential Address" })
                            }
                          ),
                          a!columnsLayout(
                            columns: {
                              a!columnLayout(
                                contents: {
                                  a!textField(
                                    label: "Door No",
                                    labelPosition: "ABOVE",
                                    value: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{fdc110a6-f5d7-41ec-b5ff-2418a10385aa}RADoorNumber'],
                                    saveInto: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{fdc110a6-f5d7-41ec-b5ff-2418a10385aa}RADoorNumber'],
                                    refreshAfter: "UNFOCUS",
                                    showWhen: contains({ 2, 5 }, local!currentStep),
                                    disabled: contains({ 5 }, local!currentStep),
                                    validations: {}
                                  )
                                }
                              ),
                              a!columnLayout(
                                contents: {
                                  a!textField(
                                    label: "Street",
                                    labelPosition: "ABOVE",
                                    value: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{3ed1477c-a303-43f1-a230-2fc494b5a144}RAStreet'],
                                    saveInto: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{3ed1477c-a303-43f1-a230-2fc494b5a144}RAStreet'],
                                    refreshAfter: "UNFOCUS",
                                    showWhen: contains({ 2, 5 }, local!currentStep),
                                    disabled: contains({ 5 }, local!currentStep),
                                    validations: {}
                                  )
                                }
                              ),
                              a!columnLayout(
                                contents: {
                                  a!textField(
                                    label: "City",
                                    labelPosition: "ABOVE",
                                    value: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{d8f6f5a8-2c56-4d4c-8668-39a81cfef6b6}RACity'],
                                    saveInto: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{d8f6f5a8-2c56-4d4c-8668-39a81cfef6b6}RACity'],
                                    refreshAfter: "UNFOCUS",
                                    showWhen: contains({ 2, 5 }, local!currentStep),
                                    disabled: contains({ 5 }, local!currentStep),
                                    validations: {}
                                  )
                                }
                              )
                            }
                          ),
                          a!columnsLayout(
                            columns: {
                              a!columnLayout(
                                contents: {
                                  a!textField(
                                    label: "State",
                                    labelPosition: "ABOVE",
                                    value: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{57350a55-e145-458c-9beb-66995979fc48}RAState'],
                                    saveInto: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{57350a55-e145-458c-9beb-66995979fc48}RAState'],
                                    refreshAfter: "UNFOCUS",
                                    showWhen: contains({ 2, 5 }, local!currentStep),
                                    disabled: contains({ 5 }, local!currentStep),
                                    validations: {}
                                  )
                                }
                              ),
                              a!columnLayout(
                                contents: {
                                  a!textField(
                                    label: "Country",
                                    labelPosition: "ABOVE",
                                    value: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{bc6be584-f850-4629-99ad-11a8abeedd71}RACountry'],
                                    saveInto: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{bc6be584-f850-4629-99ad-11a8abeedd71}RACountry'],
                                    refreshAfter: "UNFOCUS",
                                    showWhen: contains({ 2, 5 }, local!currentStep),
                                    disabled: contains({ 5 }, local!currentStep),
                                    validations: {}
                                  )
                                }
                              ),
                              a!columnLayout(
                                contents: {
                                  a!textField(
                                    label: "Postal Code",
                                    labelPosition: "ABOVE",
                                    value: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{069d0d97-c731-4bda-816a-2b7d7f77d7c3}RAPostCode'],
                                    saveInto: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{069d0d97-c731-4bda-816a-2b7d7f77d7c3}RAPostCode'],
                                    refreshAfter: "UNFOCUS",
                                    showWhen: contains({ 2, 5 }, local!currentStep),
                                    disabled: contains({ 5 }, local!currentStep),
                                    validations: {}
                                  )
                                }
                              )
                            }
                          )
                        },
                        height: "AUTO",
                        style: "TRANSPARENT",
                        marginBelow: "STANDARD"
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!cardLayout(
                        contents: {
                          a!radioButtonField(
                            choiceLabels: { "Yes", "No" },
                            choiceValues: { 1, 2 },
                            label: "Postal Address same as Residential Address?",
                            value: local!addressdifference,
                            saveInto: {
                              local!addressdifference,
                              ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{31f93477-2967-452e-884a-59e68e847aa4}PostalAddressDifferent'],
                              if(
                                (tointeger(local!addressdifference) = 2),
                                {
                                  a!save(
                                    ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{4176186e-67dc-4165-9e81-2ec0c7201bb8}PADoorNumber'],
                                    {}
                                  ),
                                  a!save(
                                    ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{b32c00ac-7f72-47e4-a4e7-e2951de12be8}PAStreet'],
                                    {}
                                  ),
                                  a!save(
                                    ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{a87a8af2-72b0-4f82-b158-df7b59a41300}PACity'],
                                    {}
                                  ),
                                  a!save(
                                    ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{db9413ba-d29f-4a2b-88a6-eba5ad17da88}PAState'],
                                    {}
                                  ),
                                  a!save(
                                    ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{8ae3a84f-ff88-4248-9b50-467bdcaee8e4}PACountry'],
                                    {}
                                  ),
                                  a!save(
                                    ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{96d15b43-a320-4d68-80cd-f2e4a37bbd1d}PAPostCode'],
                                    {}
                                  )
                                },
                                {
                                  a!save(
                                    ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{4176186e-67dc-4165-9e81-2ec0c7201bb8}PADoorNumber'],
                                    ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{fdc110a6-f5d7-41ec-b5ff-2418a10385aa}RADoorNumber']
                                  ),
                                  a!save(
                                    ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{b32c00ac-7f72-47e4-a4e7-e2951de12be8}PAStreet'],
                                    ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{3ed1477c-a303-43f1-a230-2fc494b5a144}RAStreet']
                                  ),
                                  a!save(
                                    ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{a87a8af2-72b0-4f82-b158-df7b59a41300}PACity'],
                                    ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{d8f6f5a8-2c56-4d4c-8668-39a81cfef6b6}RACity']
                                  ),
                                  a!save(
                                    ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{db9413ba-d29f-4a2b-88a6-eba5ad17da88}PAState'],
                                    ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{57350a55-e145-458c-9beb-66995979fc48}RAState']
                                  ),
                                  a!save(
                                    ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{8ae3a84f-ff88-4248-9b50-467bdcaee8e4}PACountry'],
                                    ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{bc6be584-f850-4629-99ad-11a8abeedd71}RACountry']
                                  ),
                                  a!save(
                                    ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{96d15b43-a320-4d68-80cd-f2e4a37bbd1d}PAPostCode'],
                                    ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{069d0d97-c731-4bda-816a-2b7d7f77d7c3}RAPostCode']
                                  )
                                }
                              )
                            },
                            showWhen: if(
                              or(
                                a!isNullOrEmpty(local!addressdifference),
                                contains({ 1 }, local!addressdifference)
                              ),
                              true(),
                              false()
                            )
                          )
                        },
                        showBorder: false()
                      )
                    },
                    showWhen: if(
                      a!isNullOrEmpty(local!addressdifference),
                      true(),
                      if(
                        and(
                          tointeger(local!addressdifference) = 1,
                          contains({ 2 }, local!currentStep)
                        ),
                        true(),
                        false()
                      )
                    )
                  ),
                  a!columnLayout(
                    contents: {
                      a!cardLayout(
                        contents: {
                          a!richTextDisplayField(
                            labelPosition: "COLLAPSED",
                            value: {
                              a!richTextHeader(
                                text: { "Postal Address" },
                                showWhen: or(
                                  contains({ 5 }, local!currentStep),
                                  tointeger(local!addressdifference) = 2
                                )
                              )
                            }
                          ),
                          a!columnsLayout(
                            columns: {
                              a!columnLayout(
                                contents: {
                                  a!textField(
                                    label: "Door No",
                                    labelPosition: "ABOVE",
                                    value: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{4176186e-67dc-4165-9e81-2ec0c7201bb8}PADoorNumber'],
                                    saveInto: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{4176186e-67dc-4165-9e81-2ec0c7201bb8}PADoorNumber'],
                                    refreshAfter: "UNFOCUS",
                                    showWhen: contains({ 2, 5 }, local!currentStep),
                                    disabled: contains({ 5 }, local!currentStep),
                                    validations: {}
                                  )
                                }
                              ),
                              a!columnLayout(
                                contents: {
                                  a!textField(
                                    label: "Street",
                                    labelPosition: "ABOVE",
                                    value: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{b32c00ac-7f72-47e4-a4e7-e2951de12be8}PAStreet'],
                                    saveInto: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{b32c00ac-7f72-47e4-a4e7-e2951de12be8}PAStreet'],
                                    refreshAfter: "UNFOCUS",
                                    showWhen: contains({ 2, 5 }, local!currentStep),
                                    disabled: contains({ 5 }, local!currentStep),
                                    validations: {}
                                  )
                                }
                              ),
                              a!columnLayout(
                                contents: {
                                  a!textField(
                                    label: "City",
                                    labelPosition: "ABOVE",
                                    value: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{a87a8af2-72b0-4f82-b158-df7b59a41300}PACity'],
                                    saveInto: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{a87a8af2-72b0-4f82-b158-df7b59a41300}PACity'],
                                    refreshAfter: "UNFOCUS",
                                    showWhen: contains({ 2, 5 }, local!currentStep),
                                    disabled: contains({ 5 }, local!currentStep),
                                    validations: {}
                                  )
                                }
                              )
                            },
                            showWhen: or(
                              contains({ 5 }, local!currentStep),
                              tointeger(local!addressdifference) = 2
                            )
                          ),
                          a!columnsLayout(
                            columns: {
                              a!columnLayout(
                                contents: {
                                  a!textField(
                                    label: "State",
                                    labelPosition: "ABOVE",
                                    value: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{db9413ba-d29f-4a2b-88a6-eba5ad17da88}PAState'],
                                    saveInto: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{db9413ba-d29f-4a2b-88a6-eba5ad17da88}PAState'],
                                    refreshAfter: "UNFOCUS",
                                    showWhen: contains({ 2, 5 }, local!currentStep),
                                    disabled: contains({ 5 }, local!currentStep),
                                    validations: {}
                                  )
                                }
                              ),
                              a!columnLayout(
                                contents: {
                                  a!textField(
                                    label: "Country",
                                    labelPosition: "ABOVE",
                                    value: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{8ae3a84f-ff88-4248-9b50-467bdcaee8e4}PACountry'],
                                    saveInto: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{8ae3a84f-ff88-4248-9b50-467bdcaee8e4}PACountry'],
                                    refreshAfter: "UNFOCUS",
                                    showWhen: contains({ 2, 5 }, local!currentStep),
                                    disabled: contains({ 5 }, local!currentStep),
                                    validations: {}
                                  )
                                }
                              ),
                              a!columnLayout(
                                contents: {
                                  a!textField(
                                    label: "Postal Code",
                                    labelPosition: "ABOVE",
                                    value: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{96d15b43-a320-4d68-80cd-f2e4a37bbd1d}PAPostCode'],
                                    saveInto: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{96d15b43-a320-4d68-80cd-f2e4a37bbd1d}PAPostCode'],
                                    refreshAfter: "UNFOCUS",
                                    showWhen: contains({ 2, 5 }, local!currentStep),
                                    disabled: contains({ 5 }, local!currentStep),
                                    validations: {}
                                  )
                                }
                              )
                            },
                            showWhen: or(
                              contains({ 5 }, local!currentStep),
                              tointeger(local!addressdifference) = 2
                            )
                          )
                        },
                        height: "AUTO",
                        style: "TRANSPARENT",
                        marginBelow: "STANDARD",
                        
                      )
                    },
                    showWhen: or(
                      contains({ 5 }, local!currentStep),
                      tointeger(local!addressdifference) = 2
                    )
                  )
                }
              )
            },
            showWhen: (contains({ 2, 5 }, local!currentStep)),
            style: "STANDARD",
            marginBelow: "STANDARD"
          ),
          a!boxLayout(
            label: "Foreign Tax (FATCA & CRS) - Completion of this section is mandatory",
            contents: {
              a!cardLayout(
                contents: {
                  a!sideBySideLayout(
                    items: {
                      a!sideBySideItem(
                        item: a!richTextDisplayField(
                          labelPosition: "COLLAPSED",
                          value: {
                            a!richTextItem(
                              text: "Are you a U.S. citizen, U.S. resident for tax purposes or resident for tax purposes of any other country (other than Australia)?"
                            )
                          }
                        ),
                        width: "8X"
                      ),
                      a!sideBySideItem(
                        item: a!radioButtonField(
                          choiceLabels: { "Yes", "No" },
                          choiceValues: { 1, 2 },
                          value: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{6012c3ae-196e-429c-99ef-62198c4b5cf4}FTaxQA'],
                          saveInto: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{6012c3ae-196e-429c-99ef-62198c4b5cf4}FTaxQA'],
                          disabled: (contains({ 5 }, local!currentStep)),
                          choiceLayout: "COMPACT"
                        ),
                        width: "2X"
                      )
                    }
                  ),
                  a!columnsLayout(
                    columns: {
                      a!columnLayout(
                        contents: {
                          a!textField(
                            label: "Country (or countries) of tax residency",
                            labelPosition: "ABOVE",
                            value: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{60a1590d-c443-4058-80d0-e323d47382c4}FTaxResidency'],
                            saveInto: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{60a1590d-c443-4058-80d0-e323d47382c4}FTaxResidency'],
                            refreshAfter: "UNFOCUS",
                            disabled: (contains({ 5 }, local!currentStep)),
                            validations: {}
                          ),
                          a!textField(
                            label: "Tax Identification Number (TIN)",
                            labelPosition: "ABOVE",
                            value: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{13131c46-08d2-4a43-a113-df588e4e07ff}FTaxTIN'],
                            saveInto: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{13131c46-08d2-4a43-a113-df588e4e07ff}FTaxTIN'],
                            refreshAfter: "UNFOCUS",
                            disabled: or(
                              contains({ 5 }, local!currentStep),
                              if(
                                isnull(
                                  ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{4a45b4eb-a08c-4579-8ca3-56e8aea43e46}FTaxEntityType']
                                ),
                                false(),
                                true()
                              )
                            ),
                            validations: {}
                          ),
                          a!radioButtonField(
                            choiceLabels: { "0$-50,000$", "Above 50,000$" },
                            choiceValues: { 1, 2 },
                            label: "Salary Range",
                            labelPosition: "ABOVE",
                            value: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{bbdfd03c-e3f7-4313-9b41-821869e64f7c}SalaryRange'],
                            saveInto: ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{bbdfd03c-e3f7-4313-9b41-821869e64f7c}SalaryRange'],
                            disabled: (contains({ 5 }, local!currentStep)),
                            choiceLayout: "COMPACT",
                            validations: {}
                          )
                        }
                      ),
                      a!columnLayout(
                        contents: {
                          a!checkboxField(
                            choiceLabels: {
                              "A) The country/jurisdiction does not issue TINs to its residents",
                              "B) The country/jurisdiction does not require the collection of the TIN. (You can only select this reason if the domestic law of the relevant jurisdiction does not require the collection of the TIN issued by such jurisdiction)",
                              "C) I am unable to obtain a TIN or equivalent number (Please explain why)"
                            },
                            choiceValues: { "1", "2", "3" },
                            label: "If you have not provided a TIN, please select a reason.",
                            value: if(
                              a!isNullOrEmpty(
                                ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{4a45b4eb-a08c-4579-8ca3-56e8aea43e46}FTaxEntityType']
                              ),
                              {},
                              split(
                                ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{4a45b4eb-a08c-4579-8ca3-56e8aea43e46}FTaxEntityType'],
                                "#"
                              )
                            ),
                            saveInto: a!save(
                              ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{4a45b4eb-a08c-4579-8ca3-56e8aea43e46}FTaxEntityType'],
                              if(
                                isnull(save!value),
                                save!value,
                                joinarray(save!value, "#")
                              )
                            ),
                            disabled: or(
                              contains({ 5 }, local!currentStep),
                              if(
                                isnull(
                                  ri!addressDetails['recordType!{364d1923-b3c4-49e7-8f58-7e975ea66c8c}B Address Details.fields.{13131c46-08d2-4a43-a113-df588e4e07ff}FTaxTIN']
                                ),
                                false(),
                                true()
                              )
                            )
                          )
                        }
                      )
                    }
                  )
                },
                height: "AUTO",
                showWhen: contains({ 3, 5 }, local!currentStep),
                style: "TRANSPARENT",
                marginBelow: "STANDARD"
              )
            },
            showWhen: (contains({ 3, 5 }, local!currentStep)),
            style: "STANDARD",
            marginBelow: "STANDARD"
          ),
          a!boxLayout(
            label: "Documents",
            contents: {
              rule!B_DocumentUploadUI(
                Documents: ri!Documents,
                upload: ri!upload
              )
            },
            showWhen: (contains({ 4 }, local!currentStep))
          ),
          a!boxLayout(
            showWhen: local!currentStep = 5,
            contents: {
              a!gridLayout(
                headerCells: {
                  a!gridLayoutHeaderCell(label: "Document Link"),
                  a!gridLayoutHeaderCell(label: "Document Type"),
                  a!gridLayoutHeaderCell(label: "Preview")
                },
                columnConfigs: {
                  a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 3),
                  a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 3),
                  a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 3),
                  
                },
                rows: if(
                  local!currentStep = 5,
                  a!forEach(
                    items: ri!Documents,
                    expression: a!gridRowLayout(
                      contents: {
                        a!linkField(
                          links: a!documentDownloadLink(
                            label: document(
                              index(
                                fv!item,
                                'recordType!{d68528b5-c731-45e6-88f9-b283a802e4a7}B Documents.fields.{83e65cef-4083-4f71-b6bd-42a236e0bcb5}documentId'
                              ),
                              "name"
                            ),
                            document: fv!item['recordType!{d68528b5-c731-45e6-88f9-b283a802e4a7}B Documents.fields.{83e65cef-4083-4f71-b6bd-42a236e0bcb5}documentId'],
                            
                          )
                        ),
                        a!textField(
                          value: index(
                            fv!item,
                            'recordType!{d68528b5-c731-45e6-88f9-b283a802e4a7}B Documents.fields.{1b15d2d8-c778-4919-945c-6787791f8a73}docType'
                          ),
                          readOnly: true()
                        ),
                        a!imageField(
                          images: a!documentImage(
                            document: fv!item['recordType!{d68528b5-c731-45e6-88f9-b283a802e4a7}B Documents.fields.{83e65cef-4083-4f71-b6bd-42a236e0bcb5}documentId'],
                            
                          ),
                          size: "MEDIUM"
                        )
                      }
                    )
                  ),
                  {}
                )
              )
            }
          )
        }
      ),
      a!columnsLayout(
        columns: {
          a!columnLayout(
            contents: {
              a!buttonArrayLayout(
                buttons: {
                  a!buttonWidget(
                    label: "Back",
                    saveInto: a!save(local!currentStep, local!currentStep - 1),
                    style: "OUTLINE",
                    showWhen: contains({ 2, 3, 4, 5 }, local!currentStep)
                  ),
                  a!buttonWidget(
                    label: "Cancel",
                    style: "LINK",
                    submit: true(),
                    saveInto: a!save(ri!action, false()),
                    showWhen: contains({ 1, 2, 3, 4, 5 }, local!currentStep)
                  )
                },
                align: "START"
              )
            }
          ),
          a!columnLayout(),
          a!columnLayout(
            contents: {
              a!buttonArrayLayout(
                align: "END",
                buttons: {
                  a!buttonWidget(
                    label: "Next",
                    saveInto: a!save(local!currentStep, local!currentStep + 1),
                    style: "SOLID"/*validate: true()*/,
                    showWhen: contains({ 1, 2, 3, 4 }, local!currentStep)
                  )
                },
                
              )
            }
          )
        }
      ),
      a!buttonArrayLayout(
        buttons: {
          a!buttonWidget(
            label: "Submit",
            value: true(),
            submit: true(),
            style: "LINK",
            color: "#870E40",
            showWhen: contains({ 5 }, local!currentStep),
            saveInto: {
              a!save(ri!action, true()),
              a!save(
                'recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{505c6578-5f86-4b50-8293-212929942439}createdBy',
                loggedInUser(),
                
              ),
              a!save(
                'recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{55e8b6eb-be39-469b-9e90-054fae6d8575}createdOn',
                now(),
                
              ),
              a!save(
                'recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{941cb52d-ccec-44a9-a4e1-c46d7804f4b7}modifiedBy',
                loggedInUser()
              ),
              a!save(
                'recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{f3b7a89b-6e1f-4f3d-8d4f-1718158c1dc4}modifiedOn',
                now()
              ),
              a!save(
                'recordType!{dc96ea82-6bba-4997-adab-c999fc9363cb}B Customer Account.fields.{8cef1bb1-8d29-438d-8241-01dfb326ee8a}Status',
                2
              ),
              
            }
          )
        },
        align: "END"
      )
    },
    height: "AUTO",
    style: "TRANSPARENT",
    marginBelow: "STANDARD"
  )
)

  Discussion posts and replies are publicly visible