Hello,
My $name is equal to two different fields. I am still able to save duplicated, it looks like API Before Save Script is executed before Before Save Custom Script.
What am I doing wrong?
'MyEntityType' should be this replaced with name of entity ? if is not im receivieng error 500
Field name is not required and not visible in form.
Before Save Custom Script
name = string\concatenate(taxYearRelated, ' - ', monthRelated)
API Before Save Script
if (entity\isNew() && !recordService\skipDuplicateCheck()) {
$id = record\findOne('MyEntityType', null, null, 'name=', name);
if ($id) {
recordService\throwDuplicateConflict($id);
}
}
Please help.
My $name is equal to two different fields. I am still able to save duplicated, it looks like API Before Save Script is executed before Before Save Custom Script.
What am I doing wrong?
'MyEntityType' should be this replaced with name of entity ? if is not im receivieng error 500
Field name is not required and not visible in form.
Before Save Custom Script
name = string\concatenate(taxYearRelated, ' - ', monthRelated)
API Before Save Script
if (entity\isNew() && !recordService\skipDuplicateCheck()) {
$id = record\findOne('MyEntityType', null, null, 'name=', name);
if ($id) {
recordService\throwDuplicateConflict($id);
}
}
Please help.
Comment