I want to add a universal script to zoho books for invoices and estimates (as button script).
For invoices, the variable invoice is given as function parameter.
For esitmates, the variable estimate is given as function parameter.
if(estimate){
//do
}
However, when I want to save the script, for invoices I get the error message "
Variable '
estimate' is not defined".
How can I check if a variable is defined without error, e.g.:
if(!defined(esitmate)){
esitmate = null;
}
or
esitame = esitmate ?? null;