5 use FS::Record qw( qsearchs );
9 use UNIVERSAL qw( can );
11 @ISA = qw( FS::Record );
15 FS::ac_field - Object methods for ac_field records
21 $record = new FS::ac_field \%hash;
22 $record = new FS::ac_field { 'column' => 'value' };
24 $error = $record->insert;
26 $error = $new_record->replace($old_record);
28 $error = $record->delete;
30 $error = $record->check;
34 L<FS::ac_field> contains values of fields defined by L<FS::part_ac_field>
35 for an L<FS::ac>. Values must be of the data type defined by ut_type in
37 Supported fields as follows:
41 =item acfieldpart - Type of ac_field as defined by L<FS::part_ac_field>
43 =item acnum - The L<FS::ac> to which this value belongs.
45 =item value - The contents of the field.
55 Create a new record. To add the record to the database, see L<"insert">.
59 sub table { 'ac_field'; }
63 Adds this record to the database. If there is an error, returns the error,
64 otherwise returns false.
68 Deletes this record from the database. If there is an error, returns the
69 error, otherwise returns false.
71 =item replace OLD_RECORD
73 Replaces OLD_RECORD with this one in the database. If there is an error,
74 returns the error, otherwise returns false.
78 Checks all fields to make sure this is a valid record. If there is an error,
79 returns the error, otherwise returns false. Called by the insert and replace
87 return "acnum must be defined" unless $self->acnum;
88 return "acfieldpart must be defined" unless $self->acfieldpart;
90 my $ut_func = $self->can("ut_" . $self->part_ac_field->ut_type);
91 my $error = $self->$ut_func('value');
93 return $error if $error;
100 Returns a reference to the L<FS:part_ac_field> that defines this L<FS::ac_field>
107 return qsearchs('part_ac_field', { acfieldpart => $self->acfieldpart });
112 Returns a reference to the L<FS::ac> to which this L<FS::ac_field> belongs.
119 return qsearchs('ac', { acnum => $self->acnum });
132 L<FS::svc_broadband>, L<FS::ac>, L<FS::ac_block>, L<FS::ac_field>, schema.html
133 from the base documentation.