formData.refreshBusinessStatus
(FintechOS Studio 20.1.3 and later)
Refreshes the current record's business status.
NOTE
formData.refreshBusinessStatus works only if the form is in edit mode. On insert forms, no business status is assigned to the record yet, therefore the business status cannot be refreshed.
formData.refreshBusinessStatus works only if the form is in edit mode. On insert forms, no business status is assigned to the record yet, therefore the business status cannot be refreshed.
Syntax
Copy
formData.refreshBusinessStatus(): 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.refreshBusinessStatus();
});. - 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:Copy
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 changeBusinessStatus function, see the Server SDK Reference Guide.