I have this request in the change form:
I have the category field and the root cause fields.
Some categories of development area need a root cause and others areas doesn´t need it.
I want that when the user clics the save button in order to create a change order, the function evaluates than if the category field is fill with a development category and the root cause is blank, display a message warning that if "you choose this category it must be set with a root cause, in others cases it will be ok (for example if the category is another accepts or not a root cause)"
This is my function I want to achive with spl code:
file.mod
MODIFY chg {PRE_VALIDATE zValidateRootCause() 4200 FILTER(EVENT("INSERT"));};
file.spl
chg::zValidateRootCause(...) {
string zmsgA21;
{
if (category == '401314' && rootcause == '' ) {
zmsgA21=format("For this category must be a select a root cause",chg_ref_num,requestor);
set_error(1);
set_return_data(zmsgA21);
return;
}
}
}
But when I create a change order of development area, the function doesn't evaluate the values I put on the respective fields. Root cause (Causa raíz) field is in blank and Category (Categoría) field is set with the name of development category "GD.Desarrollo". The number 401314 used on the validate function is the id of the category in the chgcat table from the mdb db.
What am I doing wrong?
I dont' know if I can do this directly in the regular form Detail_chg.htmpl
Thanks for the help you cand provide.
Regards
Carlos Ramirez
#sdmfields
#sdm
#servicedesk14.1
#spel
#spelcode
#changeorderworkflow