BuildEntity

Description

Creates a new record of the specified type and begins a submit action.

This method creates a new record and initiates a submit action, thus enabling you to begin editing the record's contents. (Vous n'avez pas besoin d'appeler EditEntity pour rendre l'enregistrement éditable.) Vous pouvez affecter des valeurs aux zones du nouvel enregistrement à l'aide de la méthode SetFieldValue de l'objet Entity renvoyé. Lorsque vous avez terminé la mise à jour de l'enregistrement, utilisez les méthodes Validate et Commit de l'objet Entity pour valider les modifications apportées à l'enregistrement.

The name you specify in the entitydef_name parameter must also correspond to an appropriate record type in the schema. To obtain a list of legal names for entitydef_name, use the GetSubmitEntityDefNames method.

Syntaxe

VBScript

session.BuildEntity (entitydef_name) 

Perl

$session->BuildEntity(entitydef_name); 
Identificateur
Description
session
Objet Session représentant la session en cours d'accès à la base de données.
nom_défentité
A String containing the name of the EntityDef Object to use as a template when creating the record.
Valeur renvoyée
A new Entity Object that was built using the named EntityDef object as a template.

Exemples

VBScript

set sessionObj = GetSession 

' Create a new "defect" record 
set entityObj = sessionObj.BuildEntity("defect") 

Perl

$sessionobj = $entity->GetSession();

# Create a new "defect" record 



$entityobj = $sessionobj->BuildEntity("defect"); 

Feedback