Checks if a document has been amended.

This function performs an asynchronous request to the server to determine if a specific document has been amended since its original creation. It helps to verify if any changes have been made to the document after it was initially created or last modified.

// Check if an 'Employee' document has been amended.
const checkParams: isDocumentAmendedParams = {
doctype: 'Employee',
docname: 'EMP-001',
};
const isAmended = await isDocumentAmended(checkParams);
console.log(isAmended); // Logs `true` if the document has been amended, `false` otherwise
// Check if a 'Project' document has been amended.
const checkParams: isDocumentAmendedParams = {
doctype: 'Project',
docname: 'PRJ-2024',
};
const isAmended = await isDocumentAmended(checkParams);
console.log(isAmended); // Logs `true` if the document has been amended, `false` otherwise

Throws an error if the request fails or if there is an issue with determining the document's amendment status.

  • Parameters

    • params: isDocumentAmendedParams

      The parameters for checking if the document has been amended. This includes:

      • doctype: The type of document to check.
      • docname: The name or identifier of the document to check.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating whether the document has been amended. Returns true if the document has been amended, otherwise false.