No data being passed on to approvers on a form

Hello,
I have a form with 2 sets of approvers:

  • When 1st approver accepts the task, there is one section of the form that has no data... Any ideas why there is no data on that form?
  • If the 1st approver fills in the data and approved the form, the 2nd approver does receive the task however the form he is trying to approve has ZERO data on all the fields, completely blank. Any ideas why?

Thank you for the help.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    The only thing I can guess without further details is that your user input task data inputs are not configured correctly, likely a variation on the same issue for both of your tasks.  When you look at the process instance do you see the data entered by the user who filled out the first task, for instance?

  • Mike,
    You were correct, the rule inputs were not mapped correctly. It all looks good except for the section that has that sum calculation you were so kind to help me with. That data is not being passed on when I go to ACTION  and have to approve either the 1st or second form.

    Mike, I did verify that the rule inputs are mapped correctly to the variables.

  • 0
    Certified Lead Developer
    in reply to antoniom0004

    Your local!sumByOnly variable is only a local variable - currently it's just calculating a sum of the values in its definition and displaying that value in the form, but not doing anything else.  To pass this calculated value back out into the process, you would need to add a new Rule Input variable to hold that value, and (this is where my prior comment comes in), add a saveInto to your submit button which captures the local variable value into the rule input.

    In this example, I've added ri!sumValue which you would need to add as a rule input in your interface, and then configure appropriately in your user input task.

    a!localVariables(
      local!mgmtFee,
      local!expenses,
      local!expCapital,
      local!incFee,
      local!mgtFeeCap,
      local!invContri,
      
      local!sumBuyOnly: sum(
        {
          local!mgmtFee,
          local!expenses,
          local!expCapital,
          local!incFee,
          local!mgtFeeCap,
          local!invContri,
        }
      ),
      
      local!authCategoryChoices: {
        "Private Equity / Limited Partnership",
        "Real Estate",
        "Fixed Income",
        "Equity",
        "Dreyfus",
        "Futures",
        "Mutual Fund / Direct Holdings / Other Alternatives",
        "Cash Allocation",
        "Special Instructions",
        "Separate Account"
      },
      /* instead of using the same long lists of hardcoded choices (twice) directly in the dropdown definitions, it would allow greater flexibility to declare them as array variables up-front and then refer directly to those variables later on. */
      local!assetClassChoices: {
        "Fixed Income",
        "Domestic Equity",
        "International Equity",
        "Real Estate",
        "Alternative Assets - Other",
        "Hybrid Equity",
        "Non-Investment Grade Debt",
        "Multi Assets",
        "Real Assets"
      },
    
      local!readOnly: ri!step = "APPROVAL",
      local!labelPosition: if(local!readOnly, "ADJACENT", "ABOVE"),
      
      a!formLayout(
        label: if(local!readOnly, "Authorization Form", "Submit Authorization Form"),
        contents: {
          a!sectionLayout(
            label: "General Information",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!dropdownField(
                        label: "Authorization Category",
                        labelPosition: "ABOVE",
                        placeholderLabel: "- Select an Authorization Category -",
                        choiceLabels: local!authCategoryChoices,
                        choiceValues: local!authCategoryChoices,
                        value: ri!auth_category,
                        saveInto: ri!auth_category,
                        required: true
                      ),
    
                      a!dropdownField(
                        label: "Authorization Type",
                        labelPosition: "ABOVE",
                        placeholderLabel: "- Select an Authorization Type -",                  
                        choiceLabels: {
                          "Buy/Expense",
                          "Sell",
                          "Buy and Sell"
                        },
                        choiceValues: {
                          "Buy/Expense",
                          "Sell",
                          "Buy and Sell"
                        },
                        value: ri!auth_type,
                        saveInto: ri!auth_type,
                        required: true
                      ),
                      a!dropdownField(
                        label: "Priority",
                        placeholderLabel: "- Select a Priority -",
                        choiceLabels: {
                          "High",
                          "Medium",
                          "Low"
                        },
                        choiceValues: {
                          "High",
                          "Medium",
                          "Low"  
                        },
                        value: ri!priority,
                        saveInto: ri!priority,
                        validations: {}
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!radioButtonField(
                        label: "Authorization Status",
                        choiceLabels: {
                          "Preliminary",
                          "Final"
                        },
                        choiceValues: {
                          "Preliminary",
                          "Final"
                        },
                        value: ri!auth_status,
                        saveInto: ri!auth_status,
                        required: true,
                        choiceLayout: "STACKED"
                      ),
                      a!dropdownField(
                        label: "Asset Class",
                        placeholderLabel: "- Select an Asset Class -",
                        choiceLabels: local!assetClassChoices,
                        choiceValues: local!assetClassChoices,
                        value: ri!asset_class,
                        saveInto: ri!asset_class,
                        required: true
                      ),
                      a!paragraphField(
                        label: "Rationale of Authorization Transaction",
                        value: ri!rationale,
                        saveInto: ri!rationale,
                        required: true,
                        height: "MEDIUM"
                      )
                    }
                  )
                }
              )
            }
          ),
    
          a!sectionLayout(
            label: "Buy",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Mgmt Fee",
                        value: local!mgmtFee,
                        saveInto: local!mgmtFee
                      ),
                      a!textField(
                        label: "Expenses",
                        value: local!expenses,
                        saveInto: local!expenses
                      ),
                      a!textField(
                        label: "Expenses Capitalized",
                        value: local!expCapital,
                        saveInto: local!expCapital
                      ),
                      a!textField(
                        label: "Sum of Buy Only",
                        value: local!sumBuyOnly,
                        saveInto: local!sumBuyOnly
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Incentive Fee",
                        value: local!incFee,
                        saveInto: local!incFee
                      ),
                      a!textField(
                        label: "Mgt Fee Capitalized",
                        value: local!mgtFeeCap,
                        saveInto: local!mgtFeeCap
                      ),
                      a!textField(
                        label: "Investment Contribution",
                        value: local!invContri,
                        saveInto: local!invContri
                      )
                    }
                  )
                }
              )
            },
            /* show this section only when authorization type = private equity */
            showWhen: ri!auth_category = /*"Private Equity / Limited Partnership",*/ local!authCategoryChoices[1]
          ),
    
          a!sectionLayout(
            label: "Total",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!floatingPointField(
                        label: "Total Amount (Sell should be neg; buy/sell is 0; Buy is pos)",
                        value: ri!total,
                        saveInto: ri!total
                      ),
                      a!dateField(
                        label: "Trade Date",
                        value: ri!tradeDate,
                        saveInto: ri!tradeDate
                      ),
                      a!dropdownField(
                        label: "Company",
                        placeholderLabel: "- Select a Company -",
                        choiceLabels: {
                          "RET",
                          "DHC",
                          "PRM",
                          "DMI",
                          "DMS",
                          "DHR",
                          "DMA",
                          "GEN"
                        },
                        choiceValues: {
                          "RET",
                          "DHC",
                          "PRM",
                          "DMI",
                          "DMS",
                          "DHR",
                          "DMA",
                          "GEN"
                        },
                        value: ri!company,
                        saveInto: ri!company
                      ),
                      a!textField(
                        label: "FundName - Investment DB",
                        value: ri!fundName,
                        saveInto: ri!fundName
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!floatingPointField(
                        label: "Remaining Commitment",
                        value: ri!remainingCommitment,
                        saveInto: ri!remainingCommitment
                      ),
                      a!dateField(
                        label: "Settlement Date (Accounting)",
                        value: ri!settlementDate,
                        saveInto: ri!settlementDate
                      ),
                      a!textField(
                        label: "FundID - Lookup from Investment DB",
                        value: ri!fundID,
                        saveInto: ri!fundID
                      ),
                      a!textField(
                        label: "Shares",
                        value: ri!shares,
                        saveInto: ri!shares
                      )
                    }
                  )
                }
              )
            },
            /* show this section only when authorization type is "Fixed Income" */
            showwhen: ri!auth_category = /*"Fixed Income",*/ local!authCategoryChoices[3]
          ),
    
          a!sectionLayout(
            label: "Bank Information",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Bank Template",
                        value: ri!bankTemplate,
                        saveInto: ri!bankTemplate,
                        required: true
                      ),
                      a!integerField(
                        label: "Bank Account",
                        value: ri!bankAccount,
                        saveInto: ri!bankAccount,
                        required: true
                      ),
                      a!textField(
                        label: "Bank Name",
                        value: ri!bankName,
                        saveInto: ri!bankName,
                        required: true
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!integerField(
                        label: "Bank Routing",
                        value: ri!bankRouting,
                        saveInto: ri!bankRouting,
                        required: true
                      ),
                      a!textField(
                        label: "Bank Reference",
                        value: ri!bankReference,
                        saveInto: ri!bankReference,
                        required: true
                      ),
                      a!textField(
                        label: "Bank Account Name",
                        value: ri!bankAccountName,
                        saveInto: ri!bankAccountName,
                        required: true
                      )
                    }
                  )
                }
              )
            }
          ),
    
          a!paragraphField(
            label: "Comments",
            value: ri!comments,
            saveInto: ri!comments,
            required: true,
            height: "MEDIUM"
          ),
          a!fileUploadField(
            label: "Wiring Instructions and/or Support",
            saveInto: {}
          ),
    
          a!sectionLayout(
            label: "Approval Information",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!radioButtonField(
                        label: "CIO Override",
                        labelPosition: "ABOVE",
                        choiceLabels: {
                          "Send to CIO",
                          "No - Regular Approval"                
                        },
                        choiceValues: {
                          "Send to CIO",
                          "No - Regular Approval"
                        },
                        value: ri!cioOverride,
                        saveinto: ri!cioOverride,
                        required: true,
                        choiceLayout: "STACKED"
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!dropdownField(
                        label: "1st Level Approval ",
                        labelPosition: "ABOVE",
                        placeholderLabel: "- Select an Approval -",
                        choiceLabels: {
                          "Brian Buxton - Portfolion Manager III",
                          "Brian Israelsen - Senior Portfolio Manager",
                          "Colton Dye",
                          "Daniel Anderson",
                          "Evan Christensen"
                        },
                        choiceValues: {
                          "Brian Buxton - Portfolion Manager III",
                          "Brian Israelsen - Senior Portfolio Manager",
                          "Colton Dye",
                          "Daniel Anderson",
                          "Evan Christensen"
                        },
                        value: ri!firstLevelApproval,
                        saveInto: ri!firstLevelApproval,
                        required: true,
                        validations: {}
                      )
                    }
                  )
                }
              ),
              a!radioButtonField(
                label: "Radio Buttons",
                labelPosition: "COLLAPSED",
                choiceLabels: {"Approve", "Reject"},
                choiceValues: {true, false},
                value: ri!approve,
                saveInto: ri!approve,
                showWhen: local!readOnly,
                required: true
              )
            }
          )
        },
        buttons: a!buttonLayout(
          primaryButtons: {
            a!buttonWidget(
              label: "Submit",
              submit: true,
              style: "PRIMARY",
              saveInto: {
                a!save(
                  ri!sumValue,
                  /* ri!sumValue will need to be added */
                  local!sumBuyOnly
                )
              }
            )
          },
          secondaryButtons: {
            a!buttonWidget(
              label: "Cancel",
              value: true,
              saveInto: ri!cancel,
              submit: true,
              style: "NORMAL",
              showWhen: not(local!readOnly),
              validate: false
            )
          }
        )
      )
    )

  • Mike,

    Maybe I did not explain myself correctly...

    I do not want to pass just the calculated value, I want to pass all the values on those fields because the approvers might need to change them throughout the process.

    I hope that helps.

  • 0
    Certified Lead Developer
    in reply to antoniom0004

    Your other values in that section are also only being stored as local variables.  When I first sent you this code sample I commented that they should probably all be replaced with "ri!" variables for your real implementation, which you haven't done.

  • If I replace them with "ri!" variables the sum variable will not work anymore since the "local!" variable is what being called for for the "sum", I hope I make sense.

  • You should be able to replace all instances of those local variables with rule inputs instead. So wherever you see local!mgmtFee for example, replace it with the corresponding rule input (and do the same with all of those variables at the top). Then, remove all of your local variables except local!sumBuyOnly, local!authCategoryChoices, local!assetClassChoices, local!readOnly, and local!labelPosition.

  • I am getting:

    Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function a!localvariables: Local variables may only be defined within the “local” domain. The local variable ’’ri!mgmtfee’’ uses an invalid domain.

    The variable ri!mgmtFee is spelled correctly and matches throughout the code

    a!localVariables(
      ri!mgmtFee,
      ri!expenses,
      ri!expCapital,
      ri!incFee,
      ri!mgtFeeCap,
      ri!invContri,
      
      ri!sumBuyOnly: sum(
    {
      ri!mgmtFee,
      ri!expenses,
      ri!expCapital,
      ri!incFee,
      ri!mgtFeeCap,
      ri!invContri,
    }
    ),
      
      local!authCategoryChoices: {
        "Private Equity / Limited Partnership",
        "Real Estate",
        "Fixed Income",
        "Equity",
        "Dreyfus",
        "Futures",
        "Mutual Fund / Direct Holdings / Other Alternatives",
        "Cash Allocation",
        "Special Instructions",
        "Separate Account"
      },
      /* instead of using the same long lists of hardcoded choices (twice) directly in the dropdown definitions, it would allow greater flexibility to declare them as array variables up-front and then refer directly to those variables later on. */
      local!assetClassChoices: {
        "Fixed Income",
        "Domestic Equity",
        "International Equity",
        "Real Estate",
        "Alternative Assets - Other",
        "Hybrid Equity",
        "Non-Investment Grade Debt",
        "Multi Assets",
        "Real Assets"
      },
    
      /* commenting these out since they're not actually being used in the form anywhere */
      /*local!mgmtFee,*/
      /*local!expenses,*/
      /*local!expCapital,*/
      /*local!sumBuyOnly,*/
      /*local!incFee,*/
      /*local!mgtFeeCap,*/
      /*local!invContri,*/
      /**/
      /*local!total: sum(*/
      /*{*/
      /*local!mgmtFee,*/
      /*local!expenses,*/
      /*local!expCapital,*/
      /*local!sumBuyOnly,*/
      /*local!incFee,*/
      /*local!mgtFeeCap,*/
      /*local!invContri*/
      /*}*/
      /*),*/
    
    local!readOnly: ri!step="APPROVAL",
    local!labelPosition: if(local!readOnly, "ADJACENT", "ABOVE"),
      
      a!formLayout(
        label: if(local!readOnly, "Authorization Form", "Submit Authorization Form"),
        contents: {
          a!sectionLayout(
            label: "General Information",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!dropdownField(
                        label: "Authorization Category",
                        labelPosition: "ABOVE",
                        placeholderLabel: "- Select an Authorization Category -",
                        choiceLabels: local!authCategoryChoices,
                        choiceValues: local!authCategoryChoices,
                        value: ri!auth_category,
                        saveInto: ri!auth_category,
                        required: true
                      ),
    
                      a!dropdownField(
                        label: "Authorization Type",
                        labelPosition: "ABOVE",
                        placeholderLabel: "- Select an Authorization Type -",                  
                        choiceLabels: {
                          "Buy/Expense",
                          "Sell",
                          "Buy and Sell"
                        },
                        choiceValues: {
                          "Buy/Expense",
                          "Sell",
                          "Buy and Sell"
                        },
                        value: ri!auth_type,
                        saveInto: ri!auth_type,
                        required: true
                      ),
                      a!dropdownField(
                        label: "Priority",
                        placeholderLabel: "- Select a Priority -",
                        choiceLabels: {
                          "High",
                          "Medium",
                          "Low"
                        },
                        choiceValues: {
                          "High",
                          "Medium",
                          "Low"  
                        },
                        value: ri!priority,
                        saveInto: ri!priority,
                        validations: {}
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!radioButtonField(
                        label: "Authorization Status",
                        choiceLabels: {
                          "Preliminary",
                          "Final"
                        },
                        choiceValues: {
                          "Preliminary",
                          "Final"
                        },
                        value: ri!auth_status,
                        saveInto: ri!auth_status,
                        required: true,
                        choiceLayout: "STACKED"
                      ),
                      a!dropdownField(
                        label: "Asset Class",
                        placeholderLabel: "- Select an Asset Class -",
                        choiceLabels: local!assetClassChoices,
                        choiceValues: local!assetClassChoices,
                        value: ri!asset_class,
                        saveInto: ri!asset_class,
                        required: true
                      ),
                      a!paragraphField(
                        label: "Rationale of Authorization Transaction",
                        value: ri!rationale,
                        saveInto: ri!rationale,
                        required: true,
                        height: "MEDIUM"
                      )
                    }
                  )
                }
              )
            }
          ),
    
          a!sectionLayout(
            label: "Buy",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Mgmt Fee",
                        value: ri!mgmtFee,
                        saveInto: ri!mgmtFee
                      ),
                      a!textField(
                        label: "Expenses",
                        value: ri!expenses,
                        saveInto: ri!expenses
                      ),
                      a!textField(
                        label: "Expenses Capitalized",
                        value: ri!expCapital,
                        saveInto: ri!expCapital
                      ),
                      a!textField(
                        label: "Sum of Buy Only",
                        value: ri!sumBuyOnly,
                        saveInto: ri!sumBuyOnly
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Incentive Fee",
                        value: ri!incFee,
                        saveInto: ri!incFee
                      ),
                      a!textField(
                        label: "Mgt Fee Capitalized",
                        value: ri!mgtFeeCap,
                        saveInto: ri!mgtFeeCap
                      ),
                      a!textField(
                        label: "Investment Contribution",
                        value: ri!invContri,
                        saveInto: ri!invContri
                      )
                    }
                  )
                }
              )
            },
            /* show this section only when authorization type = private equity */
            showWhen: ri!auth_category = /*"Private Equity / Limited Partnership",*/ local!authCategoryChoices[1]
          ),
    
          a!sectionLayout(
            label: "Total",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!floatingPointField(
                        label: "Total Amount (Sell should be neg; buy/sell is 0; Buy is pos)",
                        value: ri!total,
                        saveInto: ri!total
                      ),
                      a!dateField(
                        label: "Trade Date",
                        value: ri!tradeDate,
                        saveInto: ri!tradeDate
                      ),
                      a!dropdownField(
                        label: "Company",
                        placeholderLabel: "- Select a Company -",
                        choiceLabels: {
                          "RET",
                          "DHC",
                          "PRM",
                          "DMI",
                          "DMS",
                          "DHR",
                          "DMA",
                          "GEN"
                        },
                        choiceValues: {
                          "RET",
                          "DHC",
                          "PRM",
                          "DMI",
                          "DMS",
                          "DHR",
                          "DMA",
                          "GEN"
                        },
                        value: ri!company,
                        saveInto: ri!company
                      ),
                      a!textField(
                        label: "FundName - Investment DB",
                        value: ri!fundName,
                        saveInto: ri!fundName
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!floatingPointField(
                        label: "Remaining Commitment",
                        value: ri!remainingCommitment,
                        saveInto: ri!remainingCommitment
                      ),
                      a!dateField(
                        label: "Settlement Date (Accounting)",
                        value: ri!settlementDate,
                        saveInto: ri!settlementDate
                      ),
                      a!textField(
                        label: "FundID - Lookup from Investment DB",
                        value: ri!fundID,
                        saveInto: ri!fundID
                      ),
                      a!textField(
                        label: "Shares",
                        value: ri!shares,
                        saveInto: ri!shares
                      )
                    }
                  )
                }
              )
            },
            /* show this section only when authorization type is "Fixed Income" */
            showwhen: ri!auth_category = /*"Fixed Income",*/ local!authCategoryChoices[3]
          ),
    
          a!sectionLayout(
            label: "Bank Information",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Bank Template",
                        value: ri!bankTemplate,
                        saveInto: ri!bankTemplate,
                        required: true
                      ),
                      a!integerField(
                        label: "Bank Account",
                        value: ri!bankAccount,
                        saveInto: ri!bankAccount,
                        required: true
                      ),
                      a!textField(
                        label: "Bank Name",
                        value: ri!bankName,
                        saveInto: ri!bankName,
                        required: true
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!integerField(
                        label: "Bank Routing",
                        value: ri!bankRouting,
                        saveInto: ri!bankRouting,
                        required: true
                      ),
                      a!textField(
                        label: "Bank Reference",
                        value: ri!bankReference,
                        saveInto: ri!bankReference,
                        required: true
                      ),
                      a!textField(
                        label: "Bank Account Name",
                        value: ri!bankAccountName,
                        saveInto: ri!bankAccountName,
                        required: true
                      )
                    }
                  )
                }
              )
            }
          ),
    
          a!paragraphField(
            label: "Comments",
            value: ri!comments,
            saveInto: ri!comments,
            required: true,
            height: "MEDIUM"
          ),
          a!fileUploadField(
            label: "Wiring Instructions and/or Support",
            saveInto: {}
          ),
    
          a!sectionLayout(
            label: "Approval Information",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!radioButtonField(
                        label: "CIO Override",
                        labelPosition: "ABOVE",
                        choiceLabels: {
                          "Send to CIO",
                          "No - Regular Approval"                
                        },
                        choiceValues: {
                          "Send to CIO",
                          "No - Regular Approval"
                        },
                        value: ri!cioOverride,
                        saveinto: ri!cioOverride,
                        required: true,
                        choiceLayout: "STACKED"
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!dropdownField(
                        label: "1st Level Approval ",
                        labelPosition: "ABOVE",
                        placeholderLabel: "- Select an Approval -",
                        choiceLabels: {
                          "Brian Buxton - Portfolion Manager III",
                          "Brian Israelsen - Senior Portfolio Manager",
                          "Colton Dye",
                          "Daniel Anderson",
                          "Evan Christensen"
                        },
                        choiceValues: {
                          "Brian Buxton - Portfolion Manager III",
                          "Brian Israelsen - Senior Portfolio Manager",
                          "Colton Dye",
                          "Daniel Anderson",
                          "Evan Christensen"
                        },
                        value: ri!firstLevelApproval,
                        saveInto: ri!firstLevelApproval,
                        required: true,
                        validations: {}
                      )
                    }
                  )
                }
              ),
              a!radioButtonField(
                label: "Radio Buttons",
                labelPosition: "COLLAPSED",
                choiceLabels: {"Approve", "Reject"},
                choiceValues: {true, false},
                value: ri!approve,
                saveInto: ri!approve,
                showWhen: local!readOnly,
                required: true
              )
            }
          )
        },
        buttons: a!buttonLayout(
          primaryButtons: {
            a!buttonWidget(
              label: "Submit",
              submit: true,
              style: "PRIMARY"
            )
          },
          secondaryButtons: {
            a!buttonWidget(
              label: "Cancel",
              value: true,
              saveInto: ri!cancel,
              submit: true,
              style: "NORMAL",
              showWhen: not(local!readOnly),
              validate: false
            )
          }
        )
      )
    )

  • 0
    Certified Lead Developer
    in reply to antoniom0004

    When switching the variables from "local" to rule input ones, you would remove (or just comment out) the local variable declarations, not switch them to use the "ri!" prefix, like you have done here.  Also I notice you've changed "sumBuyOnly" to a "ri!" prefix for some reason, which of course won't work.

  • Mike,
    I am really confused... 
    I am being told to switch "local" variables to rule input ones, correct?

    a!textField(
    label: "Expenses",
    value: ri!expenses,
    saveInto: ri!expenses
    ),

    If I do this the formula "sumBuyOnly" will not recalculate anymore...
    On my business here almost 100% of the forms will have to be dynamic and in a lot of cases also have calculation fields... I really need to understand how to fix the code in order to move on. In this scenario, I thought I was doing what was suggested but apparently I am not. Any more pointers to help me figure this out are much appreciated.
    Thanks for the help Slight smile

  • You should only include local! variables at the top of your a!localVariables() statement. You don't need to declare your rule inputs in the same way; as long as you have added them to the panel on the right, you can use them directly in your interface.

    The sumBuyOnly variable should still be a local variable because you want it to recalculate using the expression you defined. I would guess your final interface would look something like this:

    a!localVariables(
      local!sumBuyOnly: sum(
        {
          ri!mgmtFee,
          ri!expenses,
          ri!expCapital,
          ri!incFee,
          ri!mgtFeeCap,
          ri!invContri,
        }
      ),
    
      local!authCategoryChoices: {
        "Private Equity / Limited Partnership",
        "Real Estate",
        "Fixed Income",
        "Equity",
        "Dreyfus",
        "Futures",
        "Mutual Fund / Direct Holdings / Other Alternatives",
        "Cash Allocation",
        "Special Instructions",
        "Separate Account"
      },
      /* instead of using the same long lists of hardcoded choices (twice) directly in the dropdown definitions, it would allow greater flexibility to declare them as array variables up-front and then refer directly to those variables later on. */
      local!assetClassChoices: {
        "Fixed Income",
        "Domestic Equity",
        "International Equity",
        "Real Estate",
        "Alternative Assets - Other",
        "Hybrid Equity",
        "Non-Investment Grade Debt",
        "Multi Assets",
        "Real Assets"
      },
    
      local!readOnly: ri!step="APPROVAL",
      local!labelPosition: if(local!readOnly, "ADJACENT", "ABOVE"),
    
      a!formLayout(
        label: if(local!readOnly, "Authorization Form", "Submit Authorization Form"),
        contents: {
          a!sectionLayout(
            label: "General Information",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!dropdownField(
                        label: "Authorization Category",
                        labelPosition: "ABOVE",
                        placeholderLabel: "- Select an Authorization Category -",
                        choiceLabels: local!authCategoryChoices,
                        choiceValues: local!authCategoryChoices,
                        value: ri!auth_category,
                        saveInto: ri!auth_category,
                        required: true
                      ),
    
                      a!dropdownField(
                        label: "Authorization Type",
                        labelPosition: "ABOVE",
                        placeholderLabel: "- Select an Authorization Type -",                  
                        choiceLabels: {
                          "Buy/Expense",
                          "Sell",
                          "Buy and Sell"
                        },
                        choiceValues: {
                          "Buy/Expense",
                          "Sell",
                          "Buy and Sell"
                        },
                        value: ri!auth_type,
                        saveInto: ri!auth_type,
                        required: true
                      ),
                      a!dropdownField(
                        label: "Priority",
                        placeholderLabel: "- Select a Priority -",
                        choiceLabels: {
                          "High",
                          "Medium",
                          "Low"
                        },
                        choiceValues: {
                          "High",
                          "Medium",
                          "Low"  
                        },
                        value: ri!priority,
                        saveInto: ri!priority,
                        validations: {}
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!radioButtonField(
                        label: "Authorization Status",
                        choiceLabels: {
                          "Preliminary",
                          "Final"
                        },
                        choiceValues: {
                          "Preliminary",
                          "Final"
                        },
                        value: ri!auth_status,
                        saveInto: ri!auth_status,
                        required: true,
                        choiceLayout: "STACKED"
                      ),
                      a!dropdownField(
                        label: "Asset Class",
                        placeholderLabel: "- Select an Asset Class -",
                        choiceLabels: local!assetClassChoices,
                        choiceValues: local!assetClassChoices,
                        value: ri!asset_class,
                        saveInto: ri!asset_class,
                        required: true
                      ),
                      a!paragraphField(
                        label: "Rationale of Authorization Transaction",
                        value: ri!rationale,
                        saveInto: ri!rationale,
                        required: true,
                        height: "MEDIUM"
                      )
                    }
                  )
                }
              )
            }
          ),
    
          a!sectionLayout(
            label: "Buy",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Mgmt Fee",
                        value: ri!mgmtFee,
                        saveInto: ri!mgmtFee
                      ),
                      a!textField(
                        label: "Expenses",
                        value: ri!expenses,
                        saveInto: ri!expenses
                      ),
                      a!textField(
                        label: "Expenses Capitalized",
                        value: ri!expCapital,
                        saveInto: ri!expCapital
                      ),
                      a!textField(
                        label: "Sum of Buy Only",
                        value: local!sumBuyOnly,
                        saveInto: local!sumBuyOnly
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Incentive Fee",
                        value: ri!incFee,
                        saveInto: ri!incFee
                      ),
                      a!textField(
                        label: "Mgt Fee Capitalized",
                        value: ri!mgtFeeCap,
                        saveInto: ri!mgtFeeCap
                      ),
                      a!textField(
                        label: "Investment Contribution",
                        value: ri!invContri,
                        saveInto: ri!invContri
                      )
                    }
                  )
                }
              )
            },
            /* show this section only when authorization type = private equity */
            showWhen: ri!auth_category = /*"Private Equity / Limited Partnership",*/ local!authCategoryChoices[1]
          ),
    
          a!sectionLayout(
            label: "Total",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!floatingPointField(
                        label: "Total Amount (Sell should be neg; buy/sell is 0; Buy is pos)",
                        value: ri!total,
                        saveInto: ri!total
                      ),
                      a!dateField(
                        label: "Trade Date",
                        value: ri!tradeDate,
                        saveInto: ri!tradeDate
                      ),
                      a!dropdownField(
                        label: "Company",
                        placeholderLabel: "- Select a Company -",
                        choiceLabels: {
                          "RET",
                          "DHC",
                          "PRM",
                          "DMI",
                          "DMS",
                          "DHR",
                          "DMA",
                          "GEN"
                        },
                        choiceValues: {
                          "RET",
                          "DHC",
                          "PRM",
                          "DMI",
                          "DMS",
                          "DHR",
                          "DMA",
                          "GEN"
                        },
                        value: ri!company,
                        saveInto: ri!company
                      ),
                      a!textField(
                        label: "FundName - Investment DB",
                        value: ri!fundName,
                        saveInto: ri!fundName
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!floatingPointField(
                        label: "Remaining Commitment",
                        value: ri!remainingCommitment,
                        saveInto: ri!remainingCommitment
                      ),
                      a!dateField(
                        label: "Settlement Date (Accounting)",
                        value: ri!settlementDate,
                        saveInto: ri!settlementDate
                      ),
                      a!textField(
                        label: "FundID - Lookup from Investment DB",
                        value: ri!fundID,
                        saveInto: ri!fundID
                      ),
                      a!textField(
                        label: "Shares",
                        value: ri!shares,
                        saveInto: ri!shares
                      )
                    }
                  )
                }
              )
            },
            /* show this section only when authorization type is "Fixed Income" */
            showwhen: ri!auth_category = /*"Fixed Income",*/ local!authCategoryChoices[3]
          ),
    
          a!sectionLayout(
            label: "Bank Information",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Bank Template",
                        value: ri!bankTemplate,
                        saveInto: ri!bankTemplate,
                        required: true
                      ),
                      a!integerField(
                        label: "Bank Account",
                        value: ri!bankAccount,
                        saveInto: ri!bankAccount,
                        required: true
                      ),
                      a!textField(
                        label: "Bank Name",
                        value: ri!bankName,
                        saveInto: ri!bankName,
                        required: true
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!integerField(
                        label: "Bank Routing",
                        value: ri!bankRouting,
                        saveInto: ri!bankRouting,
                        required: true
                      ),
                      a!textField(
                        label: "Bank Reference",
                        value: ri!bankReference,
                        saveInto: ri!bankReference,
                        required: true
                      ),
                      a!textField(
                        label: "Bank Account Name",
                        value: ri!bankAccountName,
                        saveInto: ri!bankAccountName,
                        required: true
                      )
                    }
                  )
                }
              )
            }
          ),
    
          a!paragraphField(
            label: "Comments",
            value: ri!comments,
            saveInto: ri!comments,
            required: true,
            height: "MEDIUM"
          ),
          a!fileUploadField(
            label: "Wiring Instructions and/or Support",
            saveInto: {}
          ),
    
          a!sectionLayout(
            label: "Approval Information",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!radioButtonField(
                        label: "CIO Override",
                        labelPosition: "ABOVE",
                        choiceLabels: {
                          "Send to CIO",
                          "No - Regular Approval"                
                        },
                        choiceValues: {
                          "Send to CIO",
                          "No - Regular Approval"
                        },
                        value: ri!cioOverride,
                        saveinto: ri!cioOverride,
                        required: true,
                        choiceLayout: "STACKED"
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!dropdownField(
                        label: "1st Level Approval ",
                        labelPosition: "ABOVE",
                        placeholderLabel: "- Select an Approval -",
                        choiceLabels: {
                          "Brian Buxton - Portfolion Manager III",
                          "Brian Israelsen - Senior Portfolio Manager",
                          "Colton Dye",
                          "Daniel Anderson",
                          "Evan Christensen"
                        },
                        choiceValues: {
                          "Brian Buxton - Portfolion Manager III",
                          "Brian Israelsen - Senior Portfolio Manager",
                          "Colton Dye",
                          "Daniel Anderson",
                          "Evan Christensen"
                        },
                        value: ri!firstLevelApproval,
                        saveInto: ri!firstLevelApproval,
                        required: true,
                        validations: {}
                      )
                    }
                  )
                }
              ),
              a!radioButtonField(
                label: "Radio Buttons",
                labelPosition: "COLLAPSED",
                choiceLabels: {"Approve", "Reject"},
                choiceValues: {true, false},
                value: ri!approve,
                saveInto: ri!approve,
                showWhen: local!readOnly,
                required: true
              )
            }
          )
        },
        buttons: a!buttonLayout(
          primaryButtons: {
            a!buttonWidget(
              label: "Submit",
              submit: true,
              style: "PRIMARY"
            )
          },
          secondaryButtons: {
            a!buttonWidget(
              label: "Cancel",
              value: true,
              saveInto: ri!cancel,
              submit: true,
              style: "NORMAL",
              showWhen: not(local!readOnly),
              validate: false
            )
          }
        )
      )
    )

    The only thing that I think you will still have to change is line 161. In this text field, you have a saveInto for local!sumBuyOnly. However I'm assuming you want this to be updated automatically by your sum() statement at the top, right? In that case, I would assume that this textField should be read only and should not have a saveInto option.

  • +1
    Certified Lead Developer
    in reply to antoniom0004

    Again i feel the need to reiterate my prior feedback that you should really start out with a small, simple-functionality form to learn (and really internalize) how local and rule input variables work in an Appian form, because that will make this much more intuitive to you on the whole.

    local!sumBuyOnly will still be a local variable.  The values it calls the sum() operation on, will now be rule input variables.  Updating one of those variables' values on the form (for example, ri!expenses), will cause the value of local!sumBuyOnly to re-evaluate and display the new value in real-time.

    I expect this version should work for you (keep in mind that you will still need to create the ri!sumValue rule input variable to store the result of the sum() operation as of when the user presses "Submit".

    a!localVariables(
      /* ri!mgmtFee, */
      /* ri!expenses, */
      /* ri!expCapital, */
      /* ri!incFee, */
      /* ri!mgtFeeCap, */
      /* ri!invContri, */
      
      local!sumBuyOnly: sum(
        {
          ri!mgmtFee,
          ri!expenses,
          ri!expCapital,
          ri!incFee,
          ri!mgtFeeCap,
          ri!invContri,
        }
      ),
      
      local!authCategoryChoices: {
        "Private Equity / Limited Partnership",
        "Real Estate",
        "Fixed Income",
        "Equity",
        "Dreyfus",
        "Futures",
        "Mutual Fund / Direct Holdings / Other Alternatives",
        "Cash Allocation",
        "Special Instructions",
        "Separate Account"
      },
      /* instead of using the same long lists of hardcoded choices (twice) directly in the dropdown definitions, it would allow greater flexibility to declare them as array variables up-front and then refer directly to those variables later on. */
      local!assetClassChoices: {
        "Fixed Income",
        "Domestic Equity",
        "International Equity",
        "Real Estate",
        "Alternative Assets - Other",
        "Hybrid Equity",
        "Non-Investment Grade Debt",
        "Multi Assets",
        "Real Assets"
      },
    
      local!readOnly: ri!step = "APPROVAL",
      
      a!formLayout(
        label: if(local!readOnly, "Authorization Form", "Submit Authorization Form"),
        contents: {
          a!sectionLayout(
            label: "General Information",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!dropdownField(
                        label: "Authorization Category",
                        labelPosition: "ABOVE",
                        placeholderLabel: "- Select an Authorization Category -",
                        choiceLabels: local!authCategoryChoices,
                        choiceValues: local!authCategoryChoices,
                        value: ri!auth_category,
                        saveInto: ri!auth_category,
                        required: true
                      ),
    
                      a!dropdownField(
                        label: "Authorization Type",
                        labelPosition: "ABOVE",
                        placeholderLabel: "- Select an Authorization Type -",                  
                        choiceLabels: {
                          "Buy/Expense",
                          "Sell",
                          "Buy and Sell"
                        },
                        choiceValues: {
                          "Buy/Expense",
                          "Sell",
                          "Buy and Sell"
                        },
                        value: ri!auth_type,
                        saveInto: ri!auth_type,
                        required: true
                      ),
                      a!dropdownField(
                        label: "Priority",
                        placeholderLabel: "- Select a Priority -",
                        choiceLabels: {
                          "High",
                          "Medium",
                          "Low"
                        },
                        choiceValues: {
                          "High",
                          "Medium",
                          "Low"  
                        },
                        value: ri!priority,
                        saveInto: ri!priority,
                        validations: {}
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!radioButtonField(
                        label: "Authorization Status",
                        choiceLabels: {
                          "Preliminary",
                          "Final"
                        },
                        choiceValues: {
                          "Preliminary",
                          "Final"
                        },
                        value: ri!auth_status,
                        saveInto: ri!auth_status,
                        required: true,
                        choiceLayout: "STACKED"
                      ),
                      a!dropdownField(
                        label: "Asset Class",
                        placeholderLabel: "- Select an Asset Class -",
                        choiceLabels: local!assetClassChoices,
                        choiceValues: local!assetClassChoices,
                        value: ri!asset_class,
                        saveInto: ri!asset_class,
                        required: true
                      ),
                      a!paragraphField(
                        label: "Rationale of Authorization Transaction",
                        value: ri!rationale,
                        saveInto: ri!rationale,
                        required: true,
                        height: "MEDIUM"
                      )
                    }
                  )
                }
              )
            }
          ),
    
          a!sectionLayout(
            label: "Buy",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Mgmt Fee",
                        value: ri!mgmtFee,
                        saveInto: ri!mgmtFee
                      ),
                      a!textField(
                        label: "Expenses",
                        value: ri!expenses,
                        saveInto: ri!expenses
                      ),
                      a!textField(
                        label: "Expenses Capitalized",
                        value: ri!expCapital,
                        saveInto: ri!expCapital
                      ),
                      a!textField(
                        label: "Sum of Buy Only",
                        value: local!sumBuyOnly,
                        /* saveInto: local!sumBuyOnly */
                        readOnly: true()
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Incentive Fee",
                        value: ri!incFee,
                        saveInto: ri!incFee
                      ),
                      a!textField(
                        label: "Mgt Fee Capitalized",
                        value: ri!mgtFeeCap,
                        saveInto: ri!mgtFeeCap
                      ),
                      a!textField(
                        label: "Investment Contribution",
                        value: ri!invContri,
                        saveInto: ri!invContri
                      )
                    }
                  )
                }
              )
            },
            /* show this section only when authorization type = private equity */
            showWhen: ri!auth_category = /*"Private Equity / Limited Partnership",*/ local!authCategoryChoices[1]
          ),
    
          a!sectionLayout(
            label: "Total",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!floatingPointField(
                        label: "Total Amount (Sell should be neg; buy/sell is 0; Buy is pos)",
                        value: ri!total,
                        saveInto: ri!total
                      ),
                      a!dateField(
                        label: "Trade Date",
                        value: ri!tradeDate,
                        saveInto: ri!tradeDate
                      ),
                      a!dropdownField(
                        label: "Company",
                        placeholderLabel: "- Select a Company -",
                        choiceLabels: {
                          "RET",
                          "DHC",
                          "PRM",
                          "DMI",
                          "DMS",
                          "DHR",
                          "DMA",
                          "GEN"
                        },
                        choiceValues: {
                          "RET",
                          "DHC",
                          "PRM",
                          "DMI",
                          "DMS",
                          "DHR",
                          "DMA",
                          "GEN"
                        },
                        value: ri!company,
                        saveInto: ri!company
                      ),
                      a!textField(
                        label: "FundName - Investment DB",
                        value: ri!fundName,
                        saveInto: ri!fundName
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!floatingPointField(
                        label: "Remaining Commitment",
                        value: ri!remainingCommitment,
                        saveInto: ri!remainingCommitment
                      ),
                      a!dateField(
                        label: "Settlement Date (Accounting)",
                        value: ri!settlementDate,
                        saveInto: ri!settlementDate
                      ),
                      a!textField(
                        label: "FundID - Lookup from Investment DB",
                        value: ri!fundID,
                        saveInto: ri!fundID
                      ),
                      a!textField(
                        label: "Shares",
                        value: ri!shares,
                        saveInto: ri!shares
                      )
                    }
                  )
                }
              )
            },
            /* show this section only when authorization type is "Fixed Income" */
            showwhen: ri!auth_category = /*"Fixed Income",*/ local!authCategoryChoices[3]
          ),
    
          a!sectionLayout(
            label: "Bank Information",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Bank Template",
                        value: ri!bankTemplate,
                        saveInto: ri!bankTemplate,
                        required: true
                      ),
                      a!integerField(
                        label: "Bank Account",
                        value: ri!bankAccount,
                        saveInto: ri!bankAccount,
                        required: true
                      ),
                      a!textField(
                        label: "Bank Name",
                        value: ri!bankName,
                        saveInto: ri!bankName,
                        required: true
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!integerField(
                        label: "Bank Routing",
                        value: ri!bankRouting,
                        saveInto: ri!bankRouting,
                        required: true
                      ),
                      a!textField(
                        label: "Bank Reference",
                        value: ri!bankReference,
                        saveInto: ri!bankReference,
                        required: true
                      ),
                      a!textField(
                        label: "Bank Account Name",
                        value: ri!bankAccountName,
                        saveInto: ri!bankAccountName,
                        required: true
                      )
                    }
                  )
                }
              )
            }
          ),
    
          a!paragraphField(
            label: "Comments",
            value: ri!comments,
            saveInto: ri!comments,
            required: true,
            height: "MEDIUM"
          ),
          a!fileUploadField(
            label: "Wiring Instructions and/or Support",
            saveInto: {}
          ),
    
          a!sectionLayout(
            label: "Approval Information",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!radioButtonField(
                        label: "CIO Override",
                        labelPosition: "ABOVE",
                        choiceLabels: {
                          "Send to CIO",
                          "No - Regular Approval"                
                        },
                        choiceValues: {
                          "Send to CIO",
                          "No - Regular Approval"
                        },
                        value: ri!cioOverride,
                        saveinto: ri!cioOverride,
                        required: true,
                        choiceLayout: "STACKED"
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!dropdownField(
                        label: "1st Level Approval ",
                        labelPosition: "ABOVE",
                        placeholderLabel: "- Select an Approval -",
                        choiceLabels: {
                          "Brian Buxton - Portfolion Manager III",
                          "Brian Israelsen - Senior Portfolio Manager",
                          "Colton Dye",
                          "Daniel Anderson",
                          "Evan Christensen"
                        },
                        choiceValues: {
                          "Brian Buxton - Portfolion Manager III",
                          "Brian Israelsen - Senior Portfolio Manager",
                          "Colton Dye",
                          "Daniel Anderson",
                          "Evan Christensen"
                        },
                        value: ri!firstLevelApproval,
                        saveInto: ri!firstLevelApproval,
                        required: true,
                        validations: {}
                      )
                    }
                  )
                }
              ),
              a!radioButtonField(
                label: "Radio Buttons",
                labelPosition: "COLLAPSED",
                choiceLabels: {"Approve", "Reject"},
                choiceValues: {true, false},
                value: ri!approve,
                saveInto: ri!approve,
                showWhen: local!readOnly,
                required: true
              )
            }
          )
        },
        buttons: a!buttonLayout(
          primaryButtons: {
            a!buttonWidget(
              label: "Submit",
              submit: true,
              style: "PRIMARY",
              saveInto: {
                a!save(
                  ri!sumValue,
                  /* ri!sumValue will need to be added */
                  local!sumBuyOnly
                )
              }
            )
          },
          secondaryButtons: {
            a!buttonWidget(
              label: "Cancel",
              value: true,
              saveInto: ri!cancel,
              submit: true,
              style: "NORMAL",
              showWhen: not(local!readOnly),
              validate: false
            )
          }
        )
      )
    )

Reply
  • +1
    Certified Lead Developer
    in reply to antoniom0004

    Again i feel the need to reiterate my prior feedback that you should really start out with a small, simple-functionality form to learn (and really internalize) how local and rule input variables work in an Appian form, because that will make this much more intuitive to you on the whole.

    local!sumBuyOnly will still be a local variable.  The values it calls the sum() operation on, will now be rule input variables.  Updating one of those variables' values on the form (for example, ri!expenses), will cause the value of local!sumBuyOnly to re-evaluate and display the new value in real-time.

    I expect this version should work for you (keep in mind that you will still need to create the ri!sumValue rule input variable to store the result of the sum() operation as of when the user presses "Submit".

    a!localVariables(
      /* ri!mgmtFee, */
      /* ri!expenses, */
      /* ri!expCapital, */
      /* ri!incFee, */
      /* ri!mgtFeeCap, */
      /* ri!invContri, */
      
      local!sumBuyOnly: sum(
        {
          ri!mgmtFee,
          ri!expenses,
          ri!expCapital,
          ri!incFee,
          ri!mgtFeeCap,
          ri!invContri,
        }
      ),
      
      local!authCategoryChoices: {
        "Private Equity / Limited Partnership",
        "Real Estate",
        "Fixed Income",
        "Equity",
        "Dreyfus",
        "Futures",
        "Mutual Fund / Direct Holdings / Other Alternatives",
        "Cash Allocation",
        "Special Instructions",
        "Separate Account"
      },
      /* instead of using the same long lists of hardcoded choices (twice) directly in the dropdown definitions, it would allow greater flexibility to declare them as array variables up-front and then refer directly to those variables later on. */
      local!assetClassChoices: {
        "Fixed Income",
        "Domestic Equity",
        "International Equity",
        "Real Estate",
        "Alternative Assets - Other",
        "Hybrid Equity",
        "Non-Investment Grade Debt",
        "Multi Assets",
        "Real Assets"
      },
    
      local!readOnly: ri!step = "APPROVAL",
      
      a!formLayout(
        label: if(local!readOnly, "Authorization Form", "Submit Authorization Form"),
        contents: {
          a!sectionLayout(
            label: "General Information",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!dropdownField(
                        label: "Authorization Category",
                        labelPosition: "ABOVE",
                        placeholderLabel: "- Select an Authorization Category -",
                        choiceLabels: local!authCategoryChoices,
                        choiceValues: local!authCategoryChoices,
                        value: ri!auth_category,
                        saveInto: ri!auth_category,
                        required: true
                      ),
    
                      a!dropdownField(
                        label: "Authorization Type",
                        labelPosition: "ABOVE",
                        placeholderLabel: "- Select an Authorization Type -",                  
                        choiceLabels: {
                          "Buy/Expense",
                          "Sell",
                          "Buy and Sell"
                        },
                        choiceValues: {
                          "Buy/Expense",
                          "Sell",
                          "Buy and Sell"
                        },
                        value: ri!auth_type,
                        saveInto: ri!auth_type,
                        required: true
                      ),
                      a!dropdownField(
                        label: "Priority",
                        placeholderLabel: "- Select a Priority -",
                        choiceLabels: {
                          "High",
                          "Medium",
                          "Low"
                        },
                        choiceValues: {
                          "High",
                          "Medium",
                          "Low"  
                        },
                        value: ri!priority,
                        saveInto: ri!priority,
                        validations: {}
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!radioButtonField(
                        label: "Authorization Status",
                        choiceLabels: {
                          "Preliminary",
                          "Final"
                        },
                        choiceValues: {
                          "Preliminary",
                          "Final"
                        },
                        value: ri!auth_status,
                        saveInto: ri!auth_status,
                        required: true,
                        choiceLayout: "STACKED"
                      ),
                      a!dropdownField(
                        label: "Asset Class",
                        placeholderLabel: "- Select an Asset Class -",
                        choiceLabels: local!assetClassChoices,
                        choiceValues: local!assetClassChoices,
                        value: ri!asset_class,
                        saveInto: ri!asset_class,
                        required: true
                      ),
                      a!paragraphField(
                        label: "Rationale of Authorization Transaction",
                        value: ri!rationale,
                        saveInto: ri!rationale,
                        required: true,
                        height: "MEDIUM"
                      )
                    }
                  )
                }
              )
            }
          ),
    
          a!sectionLayout(
            label: "Buy",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Mgmt Fee",
                        value: ri!mgmtFee,
                        saveInto: ri!mgmtFee
                      ),
                      a!textField(
                        label: "Expenses",
                        value: ri!expenses,
                        saveInto: ri!expenses
                      ),
                      a!textField(
                        label: "Expenses Capitalized",
                        value: ri!expCapital,
                        saveInto: ri!expCapital
                      ),
                      a!textField(
                        label: "Sum of Buy Only",
                        value: local!sumBuyOnly,
                        /* saveInto: local!sumBuyOnly */
                        readOnly: true()
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Incentive Fee",
                        value: ri!incFee,
                        saveInto: ri!incFee
                      ),
                      a!textField(
                        label: "Mgt Fee Capitalized",
                        value: ri!mgtFeeCap,
                        saveInto: ri!mgtFeeCap
                      ),
                      a!textField(
                        label: "Investment Contribution",
                        value: ri!invContri,
                        saveInto: ri!invContri
                      )
                    }
                  )
                }
              )
            },
            /* show this section only when authorization type = private equity */
            showWhen: ri!auth_category = /*"Private Equity / Limited Partnership",*/ local!authCategoryChoices[1]
          ),
    
          a!sectionLayout(
            label: "Total",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!floatingPointField(
                        label: "Total Amount (Sell should be neg; buy/sell is 0; Buy is pos)",
                        value: ri!total,
                        saveInto: ri!total
                      ),
                      a!dateField(
                        label: "Trade Date",
                        value: ri!tradeDate,
                        saveInto: ri!tradeDate
                      ),
                      a!dropdownField(
                        label: "Company",
                        placeholderLabel: "- Select a Company -",
                        choiceLabels: {
                          "RET",
                          "DHC",
                          "PRM",
                          "DMI",
                          "DMS",
                          "DHR",
                          "DMA",
                          "GEN"
                        },
                        choiceValues: {
                          "RET",
                          "DHC",
                          "PRM",
                          "DMI",
                          "DMS",
                          "DHR",
                          "DMA",
                          "GEN"
                        },
                        value: ri!company,
                        saveInto: ri!company
                      ),
                      a!textField(
                        label: "FundName - Investment DB",
                        value: ri!fundName,
                        saveInto: ri!fundName
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!floatingPointField(
                        label: "Remaining Commitment",
                        value: ri!remainingCommitment,
                        saveInto: ri!remainingCommitment
                      ),
                      a!dateField(
                        label: "Settlement Date (Accounting)",
                        value: ri!settlementDate,
                        saveInto: ri!settlementDate
                      ),
                      a!textField(
                        label: "FundID - Lookup from Investment DB",
                        value: ri!fundID,
                        saveInto: ri!fundID
                      ),
                      a!textField(
                        label: "Shares",
                        value: ri!shares,
                        saveInto: ri!shares
                      )
                    }
                  )
                }
              )
            },
            /* show this section only when authorization type is "Fixed Income" */
            showwhen: ri!auth_category = /*"Fixed Income",*/ local!authCategoryChoices[3]
          ),
    
          a!sectionLayout(
            label: "Bank Information",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Bank Template",
                        value: ri!bankTemplate,
                        saveInto: ri!bankTemplate,
                        required: true
                      ),
                      a!integerField(
                        label: "Bank Account",
                        value: ri!bankAccount,
                        saveInto: ri!bankAccount,
                        required: true
                      ),
                      a!textField(
                        label: "Bank Name",
                        value: ri!bankName,
                        saveInto: ri!bankName,
                        required: true
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!integerField(
                        label: "Bank Routing",
                        value: ri!bankRouting,
                        saveInto: ri!bankRouting,
                        required: true
                      ),
                      a!textField(
                        label: "Bank Reference",
                        value: ri!bankReference,
                        saveInto: ri!bankReference,
                        required: true
                      ),
                      a!textField(
                        label: "Bank Account Name",
                        value: ri!bankAccountName,
                        saveInto: ri!bankAccountName,
                        required: true
                      )
                    }
                  )
                }
              )
            }
          ),
    
          a!paragraphField(
            label: "Comments",
            value: ri!comments,
            saveInto: ri!comments,
            required: true,
            height: "MEDIUM"
          ),
          a!fileUploadField(
            label: "Wiring Instructions and/or Support",
            saveInto: {}
          ),
    
          a!sectionLayout(
            label: "Approval Information",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!radioButtonField(
                        label: "CIO Override",
                        labelPosition: "ABOVE",
                        choiceLabels: {
                          "Send to CIO",
                          "No - Regular Approval"                
                        },
                        choiceValues: {
                          "Send to CIO",
                          "No - Regular Approval"
                        },
                        value: ri!cioOverride,
                        saveinto: ri!cioOverride,
                        required: true,
                        choiceLayout: "STACKED"
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!dropdownField(
                        label: "1st Level Approval ",
                        labelPosition: "ABOVE",
                        placeholderLabel: "- Select an Approval -",
                        choiceLabels: {
                          "Brian Buxton - Portfolion Manager III",
                          "Brian Israelsen - Senior Portfolio Manager",
                          "Colton Dye",
                          "Daniel Anderson",
                          "Evan Christensen"
                        },
                        choiceValues: {
                          "Brian Buxton - Portfolion Manager III",
                          "Brian Israelsen - Senior Portfolio Manager",
                          "Colton Dye",
                          "Daniel Anderson",
                          "Evan Christensen"
                        },
                        value: ri!firstLevelApproval,
                        saveInto: ri!firstLevelApproval,
                        required: true,
                        validations: {}
                      )
                    }
                  )
                }
              ),
              a!radioButtonField(
                label: "Radio Buttons",
                labelPosition: "COLLAPSED",
                choiceLabels: {"Approve", "Reject"},
                choiceValues: {true, false},
                value: ri!approve,
                saveInto: ri!approve,
                showWhen: local!readOnly,
                required: true
              )
            }
          )
        },
        buttons: a!buttonLayout(
          primaryButtons: {
            a!buttonWidget(
              label: "Submit",
              submit: true,
              style: "PRIMARY",
              saveInto: {
                a!save(
                  ri!sumValue,
                  /* ri!sumValue will need to be added */
                  local!sumBuyOnly
                )
              }
            )
          },
          secondaryButtons: {
            a!buttonWidget(
              label: "Cancel",
              value: true,
              saveInto: ri!cancel,
              submit: true,
              style: "NORMAL",
              showWhen: not(local!readOnly),
              validate: false
            )
          }
        )
      )
    )

Children