How to get form fields values in a form in Alfresco Process Services

We will use the following javascript code inside a form function to get the value from a field whose id is “field-id”. One of the function parameters must be scope, that will provide access to the fields.

scope.findFormFieldWithId(scope.allFormFields,"field-id").value;

Some of the out-of-the-box functions that have scope as a parameter are listed as follows:

formRendered:function(form, scope)
formFieldValueChanged:function(form, field, scope)
formFieldFocus:function(form, field, scope)
formFieldBlur:function(form, field, scope)
formFieldPersonSelected:function(form, field, scope)
formFieldPersonEmailSelected:function(form, field, scope)
formFieldPersonRemoved:function(form, field, scope)
formFieldGroupSelected:function(form, field, scope)
formFieldGroupRemoved:function(form, field, scope)
formFieldContentUploaded:function(form, field, scope)
formFieldContentRemoved:function(form, field, scope)
formFieldRestValuesSet:function(form, field, scope)
formBeforeComplete:function(form, outcome, scope)
formTableFieldValueChanged:function(form, field, columnDefinition, editRow, scope)
formTableFieldFocus:function(form, field, columnDefinition, editRow, scope)
formTableFieldBlur:function(form, field, columnDefinition, editRow, scope)
formTableFieldRestValuesSet:function(form, field, columnDefinition, editRow, scope)
formTableRendered:function(form, field, columnDefinitions, editRow, scope)
formTableBeforeComplete:function(form, field, editRow, scope)
formTableBeforeCancel:function(form, field, editRow, scope)
formValidateFieldValueChanged:function(form, field, scope)
formValidateBeforeSubmit:function(form, outcome, scope)
formTableValidateFieldValueChanged:function(form, field, columnDefinition, editRow, scope)
formTableValidateBeforeComplete:function(form, field, editRow, scope)
taskCompleted:function(taskId, form, scope)
taskCompletedError:function(taskId, errorResponse, form, scope)
taskSaved:function(taskId, form, scope)
taskSavedError:function(taskId, errorResponse, form, scope)

Leave a Reply

Your email address will not be published. Required fields are marked *