I have a program which is used in an own layout. Also I need this program as a related child in another layout. For that I use a relation head_to_child_by_number. The program has a field for the number. This field should be editable if I use the program in an own layout, but the field should not editable if I use the program as a related child in another layout, because this is the head to child matching number. So I do in the head program, the following in updateUI:
function updateUI( _mode, _toolbarForm, _forceModeChange ) {
_super.updateUI( _mode, _toolbarForm, _forceModeChange );
forms[ 'formName' ].elements[ 'fld_number' ].editable = false;
return
}
I realized, if I do that and I have at the same time also the program open in which the form is used too, the field there is also not editable.
How can I have the field not editable if the program is a related child and how can I have the field editable if the program itself is the head in an own layout?