Fornisce la funzionalità ‘Trova Record’. Restituisce l'oggetto EntitiyDef per il determinato ID database del record (DBID). Il metodo richiede di specificare il tipo EntityDef e facoltativamente i nomi EntityDef in cui ricercare il DBID.
Il tipo EntityDef restituito deve essere verificato per determinare il tipo di record a cui è stata impostata la corrispondenza poiché l'array entDefNames consente le ricerche in più tipi di record. Inoltre, se ANY_ENTITY viene utilizzato come argomento entityDeftype, è necessario determinare se è stato restituito un record stateful (REQ_ENTITY) o stateless (AUX_ENTITY).
È possibile richiamare GetEntityDefOfName o GetEntityDefOfDbId per verificare se un'entità con displayName o DBID determinati esiste nel database utente. Una volta noto EntityDef, è possibile ottenere l'entità richiamando il metodo GetEntity dell'oggetto Session.
Per richiedere il tipo di record utilizzando il relativo nome di visualizzazione invece del relativo ID database, utilizzare il metodo GetEntityDefOfName.
VBScript
session.GetEntityDefOfDbId(db_id, entitydef_names,entitydef_type)
Perl
$session->GetEntityDefOfDbId(db_identitydef_names, entitydef_type);
L'ID univoco del record (Entity).
Per Visual Basic, un valore Variant che contiene un array di stringhe. Ciascuna stringa contiene il nome di un EntityDef.
Per Perl, un riferimento a un array di stringhe. Ciascuna stringa contiene il nome di un EntityDef.
I nomi di EntityDefs vengono utilizzati per ricercare l'entità identificata da displayName o DbId. L'elenco di nomi EntityDef viene ripetuto ed elaborato nel determinato ordine. Se i nomi EntityDef forniti nell'argomento entDefNames non sono validi, viene lanciata un'eccezione che identifica il nome non valido. Se viene fornito un valore array vuoto, vengono utilizzati tutti i tipi EntityDef definiti nello schema, con l'ordine di ricerca che va dall'oggetto EntityDef ricercato trovato più di frequente all'ultimo EntityDef ricercato trovato di meno.
Perl
use CQPerlExt;
# Build session...
# Log in...'Session UserLogon method'
# Determine the array of Entity Def Names for searching...
eval { $entDefNamesDB = $CQSession->GetEntityDefNames(); };
# Sort the list of entity def names returned from GetEntityDefNames()
@entDefNamesDBsorted = sort @$entDefNamesDB;
$entDefNamesDBsorted = \@entDefNamesDBsorted;
# EntityDef Names can be supplied by the user. Ad esempio:
# @entDefNamesUser = ($ARG{'EDEF1'},$ARG{'EDEF2'},$ARG{'EDEF3'});
# $entDefNamesUser = \@entDefNamesUser;
# if using user supplied EntityDef Names for searching then
# $entDefNames = $entDefNamesUser;
# else use all DB EntityDef names for searching:
$entDefNames = $entDefNamesDBsorted;
# Call CQSession->GetEntityDefOfDbId()...
my($DbId) = $ARG{'DBID'};
eval { $CQEntityDefOfDbId = $CQSession->GetEntityDefOfDbId($DbId,
$entDefNames, $ARG{'ENTTYPE'}); };
# exception handling goes here...
# Get the Entity Def Name of the record...
eval { $CQEntityDefName = $CQEntityDefOfDbId->GetName(); };
# exception handling goes here...
# Get entity...