I am migrating business rules of Pascal Script to JavaScript, I want to know if there is any way to make JavaScript alerts are similar to Pascal Script alerts.
The javascript code shows me this line: “Script failed in beforePost (108/0)” before the message in my alert.
if((row[“CODIGO”] == null) || (Trim(row[“CODIGO”]) == “”))
{
errors = errors + “Código de artículo no puede estar vacio.”+"\n";
}
if(errors != “”)
{
fail(errors);
}
I need to be shown in this way:
if (VarisNull(CODIGO)) or (Trim(CODIGO)=’’) then
errors := errors + ‘Código de artículo no puede estar vacio.’+#13
if (errors <>’’) then
RaiseError(Errors);