formData.refreshForm
(FintechOS Studio 20.1.3 and later)
Refreshes the current form:
- Refreshes the attributes' values.
- Refreshes the header items' values.
- Refreshed the form grids.
- Refreshes the business stats (equivalent to formData.refreshBusinessStatus).
- Sets formData.hasChanges to False.
NOTE
formData.refreshForm works only if the form is in edit mode.
formData.refreshForm works only if the form is in edit mode.
Syntax
Copy
formData.refreshForm(): Promise<void>
Examples
In this example:
- We set up a button called Approve on a credit record's form.
- The Approve button calls the approveCredit endpoint using the ebs.callActionByName method as defined below in the
afterGenerate.jsscript:Copy$('#Approve').on('click', function (event) {
ebs.callActionByName('approveCredit', {recordID: formData.id, entityName: formData.entityName});
formData.refreshForm();
}); - The entity name and record ID are passed to the approveCredit endpoint in the entityName and recordID variables respectively. For details, see formData.entityName and formData.id.
- The approveCredit endpoint runs the following on-demand server automation script which changes the record's business status to Approved and saves the current date and time in the approvedOn attribute:Copy
update(ftos.context.data.entityName, ftos.context.data.recordID, {approvedOn: new Date});
changeBusinessStatus(ftos.context.data.entityName, ftos.context.data.recordID, '28903b91-914a-41f5-8071-557cc9198967'); - 28903b91-914a-41f5-8071-557cc9198967 is the ID of the Approved business status. For details about the
updateandchangeBusinessStatusfunctions, see the Server SDK Reference Guide.