I am having problems accessing the "users" database from within our schema. We maintain two repositories: a test one and a development one using an Oracle database. Both are running the same schema revision (no changes to the test one since the last upgrade). The production repository operates properly. On the development side, we have suddenly developed problems accessing the user database from hook code. The code in question looks like:
my $deliv_field_subcontractor = "Subcontractor" ;
my $subcontractor_record_type = "MPM_CM_Subcontractor" ;
my $subc_field_SCA_login = "SCA_login" ;
my $deliv_field_SCA_login = "Approver_Login" ;
my $deliv_field_SCA_fullname = "Approver" ;
my $subc = $entity->GetFieldStringValue( $deliv_field_subcontractor ) ;
my $subc_entity = $entity->GetSession()->GetEntity( $subcontractor_record_type, "$subc" ) ;
my $SCA_login = $subc_entity->GetFieldStringValue( $subc_field_SCA_login ) ;
$entity->SetFieldValue( $deliv_field_SCA_login, $SCA_login ) ;
my $SCA_user_entity = $entity->GetSession()->GetEntity( 'users', '' . $SCA_login ) ;
When the highlighted line is executed, I get an error message (see attached screen shot) that there is no record of type "users" with the given name.
I have verified that the name is present in the database. I have tried different user names in the source record that are in the user database. I have used my own login name. I have created a new login and have used that user. I always get the same response. I then tried to replace the access to "users" by using the BuildQuery approach but BuildQuery returns an undefined value. I have had other users try this (same result) and have tried the Windows, Eclipse and web clients with the same results.