getCaseEditLock(caseID, context)
Locks a case so that it can be edited.
Returns
A promise that when resolved indicates that acquiring the lock of the case is successful.
Parameters
Name | Type | Description | Required |
caseID | string | The ID of the case that must be locked. | ✅ |
context | string | The name of the context where the API is being called. | ✅ |
Usage example
In this example, the API obtains a successful lock on the case so that it can be edited.
const caseID = 'METORG-VEHICLEMANAGER-WORK V-7222';
const context = 'app/primary_1';
PCore.getDataApiUtils().getCaseEditLock(caseID, context)
.then(response => {
//The response of this API is as shown below:
{
uiResources: {
resources: {},
components: [],
root: {}
},
data: {
caseInfo: {
ID: // case ID,
content: {}
}
}
}
//Having the above structure in the response indicates that the lock has been acquired successfully.
})
.catch(error => {
console.log(error);
});
Previous topic APIs in the DataApiUtils module Next topic getCaseEditMetadata(caseID, context)