Submits a document to the server for final processing.
This function performs an asynchronous request to the server to submit a document of the specified type.
Submitting a document typically means it is moved to a final state, such as "submitted" or "completed,"
depending on the document type and the business logic of the application. Once submitted, the document may
no longer be editable or may trigger additional workflows.
Example
// Submit an 'Employee' document for final processing. constemployee: BareBoneDoc = { doctype:'Employee', name:'EMP-001', employee_name:'John Doe', designation:'Software Engineer', department:'Engineering', }; constsubmittedEmployee = awaitsubmitDoc(employee); console.log(submittedEmployee); // Logs the submitted 'Employee' document, with updated state or status
Example
// Submit a 'Product' document to mark it as completed. constproduct: BareBoneDoc = { doctype:'Product', name:'PRD-123', product_name:'Laptop', price:999.99, stock:50, }; constsubmittedProduct = awaitsubmitDoc(product); console.log(submittedProduct); // Logs the submitted 'Product' document, with updated state or status
Example
// Submit an 'Order' document for final approval or processing. constorder: BareBoneDoc = { doctype:'Order', name:'ORD-456', customer_name:'Alice Smith', order_date:'2024-09-08', total_amount:299.99, }; constsubmittedOrder = awaitsubmitDoc(order); console.log(submittedOrder); // Logs the submitted 'Order' document, with updated state or status
Throws
Throws an error if the request fails or if there is an issue with the document being submitted.
Submits a document to the server for final processing.
This function performs an asynchronous request to the server to submit a document of the specified type. Submitting a document typically means it is moved to a final state, such as "submitted" or "completed," depending on the document type and the business logic of the application. Once submitted, the document may no longer be editable or may trigger additional workflows.
Example
Example
Example
Throws
Throws an error if the request fails or if there is an issue with the document being submitted.