@NicKhos Hi,
You can create an event about it.
To better understand the events you can read the documentation below. (IFS10)
https://docs.ifs.com/techdocs/Foundation1/040_administration/240_integration/320_events/default.htm
@NicKhos I’m leaving below an example of such an event action created on sub_project_tab which will trigger a toast error message. I hope this helps.
DECLARE
functional_object_rowkey_ VARCHAR2(200) := '&NEW:CF$_EQUIPMENT_OBJECT';
mch_code_ VARCHAR2(200);
project_id_ VARCHAR2(200);
sub_project_id_ VARCHAR2(200);
CURSOR get_mch_code IS
select ef.mch_code
from ifsapp.equipment_functional ef
where 1=1
and ef.objkey = functional_object_rowkey_;
CURSOR get_sub_project_ IS
select sp.project_id, sp.sub_project_id
from ifsapp.sub_project_cfv sp
where 1=1
and sp.CF$_EQUIPMENT_OBJECT_DB = functional_object_rowkey_
and ROWNUM = 1;
pragma autonomous_transaction;
BEGIN
OPEN get_sub_project_;
FETCH get_sub_project_
into project_id_, sub_project_id_;
CLOSE get_sub_project_;
IF project_id_ is not null THEN
OPEN get_mch_code;
FETCH get_mch_code
into mch_code_;
CLOSE get_mch_code;
Error_SYS.Record_General('C_SUB_PROJECT_FO', 'FO: ' || mch_code_ || ' is already assigned to Contract: ' || project_id_ || ' and Equipment: ' || sub_project_id_ || ' You cannot assign it to another Equipment.');
END IF;
END;