Get/Set/Select Control Value

  • FireStart.getControlValue(identifier, onlySelected, delimiter)
    • Gets the current value of a form control
    • @param {string} identifier - Id of the control
    • @param {boolean} onlySelected - If the control is a selection control, this flag determines if all values or only the selected values will be returned. Default is false.
    • @param {string} delimiter - Delimiter is used if the value of the control is returned as a CSV, defaults to ';'
    • @returns {string} value
  • FireStart.setControlValue(identifier, value)
    • Sets the current value of a form control
    • @param {string} identifier - Id of the control
    • @param {string} value - Value the control should have
  • FireStart.selectControlValue(identifier, values)
    • Selects records of a selection control by an array of IDs
    • @param {string} identifier - Id of the Control
    • @param {[]} values - Array of values that should be selected

Note: The functions get/set/selectControlValue() operate on the control and return/change the currently displayed control values and also trigger a change to the business entity field if the control is mapped to one.

Example Form 

This example shows how to create an HTML control that gets and sets the value of a text field and gets and selects the values of a table using the functions listed above.

The first thing is to design the form and give the controls you would like to use in the HTML control a Title.

htmlC_9_controlValue_1

Now you can write as many functions as you like, just make sure to pass the controls as a parameter.

htmlC_10_controlValue_2

 

 

HTML
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"/>
<style>
body{
background-color: whitesmoke;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
function buttonGetAllClick() {
var controlValue = FireStart.getControlValue('{##|FORMELEMENT:8|##}', false);
FireStart.setControlValue('{##|FORMELEMENT:5|##}', controlValue);
}
function buttonGetSelectedClick() {
var controlValue = FireStart.getControlValue('{##|FORMELEMENT:8|##}', true);
FireStart.setControlValue('{##|FORMELEMENT:5|##}', controlValue);
}
function buttonSelectClick() {
var str = FireStart.getControlValue('{##|FORMELEMENT:5|##}');
var array = str.split(";");
FireStart.selectControlValue('{##|FORMELEMENT:8|##}', array);
}
</script>
</head>
<body>
<div class="container">
<form>
<div class="form-group">
<button type="button" class="btn btn-primary" onclick="buttonGetAllClick()">Get all Values</button>
<button type="button" class="btn btn-primary" onclick="buttonGetSelectedClick()">Get selected Values</button>
<button type="button" class="btn btn-primary" onclick="buttonSelectClick()">Select Values</button>
</div>
</form>
</div>
</body>
</html>

 

After you finished and saved your configuration, the workflow is ready to be started. 

htmlC_11_controlValue_3htmlC_12_controlValue_4

htmlC_13_controlValue_5