...
- beforeFieldChange → gets called before the every "handleFieldChange" action. it accepts action, dispatch and state as its parameters. it can be used to set other fields or perform any action/operation on every field change. we can alter the value as well here and return the action.
- updateDependentFields → gets called on every "handleFieldChange" action and is specifically used to load dependent fields. If the data of one dropdown gets loaded only after selecting an option in the previous dropdown, then updateDependentFields hook is the right choice. it gets formKey, field, dispatch, and state as its parameters
- beforeInitForm → gets called before init form action. can be used to make api calls and popuate dropdowns, set fields, set default values etc. When this is called, at that time the same form and its state will not be available in the redux, so setting the form in the state or manipulating it is not possible. actions can be performed only on states other than self.
- afterInitform → gets called just after the init form action, its advantage is that when this gets called the form is available in the redux state, so any action can be performed on them.
PT form actions:
- setFieldProperty : eg setFieldProperty(formKey, "ownerCategoryIdType", "dropDownData", documentTypes)
- prepareFormData : eg prepareFormData(jsonPath, fieldValue)
...