% 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::prospect_main - Object methods for prospect_main records
use FS::prospect_main;
$record = new FS::prospect_main \%hash;
$record = new FS::prospect_main { 'column' => 'value' };
$error = $record->insert;
$error = $new_record->replace($old_record);
$error = $record->delete;
$error = $record->check;
An FS::prospect_main object represents a prospect. FS::prospect_main inherits from FS::Record. The following fields are currently supported:
primary key
Agent (see FS::agent)
Referral (see FS::part_referral)
company
Creates a new prospect. To add the prospect to the database, see "insert".
Note that this stores the hash reference, not a distinct copy of the hash it points to. You can ask the object for a copy with the hash method.
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
Delete this record from the database.
Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
Checks all fields to make sure this is a valid prospect. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
Returns a name for this prospect, as a string (company name for commercial prospects, contact name for residential prospects).
Returns the contacts (see FS::contact) associated with this prospect.
Returns the locations (see FS::cust_location) associated with this prospect.
Returns the qualifications (see FS::qual) associated with this prospect.
Returns the agent (see FS::agent) for this customer.
Returns the advertising source (see FS::part_referral) for this customer.
Converts this prospect to a customer.
If there is an error, returns an error message, otherwise, returns the newly-created FS::cust_main object.
(Class method)
Returns a qsearch hash expression to search for the parameters specified in HASHREF. Valid parameters are:
FS::Record, schema.html from the base documentation.