+if ( $CustomFieldObj->id && $CustomFieldObj->IsOnlyGlobal ) {
+ my ( $ret, $msg );
+ my $object = $CustomFieldObj->RecordClassFromLookupType->new( $session{'CurrentUser'} );
+
+ if ( $CustomFieldObj->Disabled && $CustomFieldObj->IsGlobal ) {
+ ( $ret, $msg ) = $CustomFieldObj->RemoveFromObject($object);
+ }
+ elsif ( !$CustomFieldObj->Disabled && !$CustomFieldObj->IsGlobal ) {
+ ( $ret, $msg ) = $CustomFieldObj->AddToObject($object);
+ }
+
+ # successful msg("object created" or "object deleted ) is useless here
+ push @results, $msg unless $ret;
+}
+