% include( '/elements/header.html', 'Developer Documentation' ) %> <& /elements/menubar.html, 'Freeside Perl Modules' => $fsurl.'docs/library/FS.html', 'Complete Index' => $fsurl.'docs/library/index.html', &>
FS::part_virtual_field - Object methods for part_virtual_field records
use FS::part_virtual_field;
$record = new FS::part_virtual_field \%hash;
$record = new FS::part_virtual_field { 'column' => 'value' };
$error = $record->insert;
$error = $new_record->replace($old_record);
$error = $record->delete;
$error = $record->check;
An FS::part_virtual_field object represents the definition of a custom field (see the BACKGROUND section). FS::part_virtual_field contains the name and base table of the field.
FS::part_virtual_field inherits from FS::Record. The following fields are currently supported:
Create a new record. To add the record to the database, see "insert".
Generates UI code for a widget suitable for editing/viewing the field, based on list_source and length.
The only UI_TYPE currently supported is 'HTML', and possible MODEs are 'view' and 'edit'.
In HTML, all widgets are assumed to be table rows. View widgets look like <TR><TD ALIGN="right">Label</TD><TD BGCOLOR="#ffffff">Value</TD></TR>
(Most of the display style stuff, such as the colors, should probably go into a separate module specific to the UI. That can wait, though. The API for this function won't change.)
VALUE (optional) is the current value of the field.
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
Deletes this record from the database. If there is an error, returns the error, otherwise returns false.
Replaces OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.