πͺ
πͺ
πͺ
πͺ
Docs
Searchβ¦
πͺ
πͺ
πͺ
πͺ
Docs
Getting Started
Client Script Doctype
Server Script Doctype
Script Reports
Powered By
GitBook
Server Script Doctype
This page provides detailed documentation for writing custom server-side nodejs code for doctype.
Event triggers
1. On Save (onSave): onSave
is triggered before saving document.
onSave
is the perfect trigger to perform your server-side validation on the entire document before anything gets saved.
1
module
.
exports
=
{
2
onSave
:
function
(
doc
)
{
3
/* your code */
4
}
5
}
Copied!
2. On Submit (onSubmit): onSubmit
is triggered before submitting document.
1
module
.
exports
=
{
2
onSave
:
function
(
doc
)
{
3
/* your code */
4
}
5
}
Copied!
3. On Delete (onDelete): onDelete
is triggered before deleting document.
onDelete
can be used to update dependent or linked data in other documents before deleting.
1
module
.
exports
=
{
2
onDelete
:
function
(
doc
)
{
3
/* your code */
4
}
5
}
Copied!
β
Previous
Client Script Doctype
Next
Script Reports
Last modified
1yr ago
Copy link