Business Component Load method

Official Content

The Load method executes something equivalent to what happens when we type an identifier value in a transaction form and exit the field. All the data corresponding to that identifier are loaded into memory (in this case in a variable based on a business component type of a transaction).

Syntax

&VbleBasedOnBCType.Load(PKAttri1, ..., PKAttriN)

Where:

&VbleBasedOnBCType
      Is a -temporary and local- variable defined in a GeneXus object, based on a business component type of a transaction.

PKAttri1, ..., PKAttriN
      Are the values that make up the primary key of a transaction first level.
      It must be a valid value for the primary key of the transaction set as a business component and the &VbleBasedOnBCType variable was defined based on it.


Example

  &Customer.Load(10)
  &Customer.CustomerEmail = 'jsmith@gmail.com'
  &Customer.save()
  commit

The above code loads in memory a customer by applying the Load method to the variable based on the Customer business component data type. Then, the next line of code modifies the customer email by assigning certain value to the &customer.CustomerEmail property. The third line of code updates phisically the record (by applying the Save method to the variable). Finally, the commit command is executed (which is indispensable).


See Also

Error handling in Business Components





 

Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.