Hello everyone, I will briefly explain the problem.
I have a subpanel inside a form (both custom), when I create a new record from the subpanel, I insert data into the fields, among them there is also a relate field.
What I would like is to check in real time the existence of the entry, the record already exists if 2 fields are equal:
ID field
Related field
I don’t have any problems with validating normal fields, but I need an idea to check the existence of the related field, as it is not part of the table and I don’t know how to do the check. Something like this:
$bean= BeanFactory::getBean('<Module>');
$beanList = $bean->get_full_list(
//Order by the id
id',
"id = '".$id."' AND deleted = 0 AND <related_field>='".$related_field_value."'"
);
Do you have any suggestions? Thanks in advance