NAME

WWW::Salesforce::Simple.pm v0.06 - this class provides a simpler abstraction layer between WWW::Salesforce and Salesforce.com.

DESCRIPTION

Because the Salesforce API is somewhat cumbersome to deal with, this class was created to make it a little simpler to get information.

METHODS

new( %parameters )

Handles creating new Salesforce objects as well as the login process to use the salesforce objects.

do_query( $sql_query_string )

Executes a query against the information in Salesforce. Returns a reference to an array of hash references keyed by the column names. Strict attention should be paid to the case of the field names.

get_field_list( $table_name )

Gathers a list of fields contained in a given table. Returns a reference to an array of hash references. The hash references have several keys which provide information about the field's type, etc. The key 'name' will provide the name of the field itself.

get_tables( )

Gathers a list of tables available for use from salesforce. Returns a reference to an array of strings representing each table name.

EXAMPLES

new()

use WWW::Salesforce::Simple;

my $sforce = WWW::Salesforce::Simple->new(
    'username' => $user,
    'password' => $pass
);

do_query( $query )

my $query = 'select Id from Account';

my $res = $sforce->do_query( $query );

foreach my $field ( @{ $res } ) {
    print $field->{'Id'} . "\n";
}
print "Found " . scalar @{$res} . " results\n";    

get_field_list( $table_name )

my $fields_ref = $sforce->get_field_list( 'Account' );

foreach my $field( @{$fields_ref} ) {
    print $field->{'name'} . "\n";
    foreach my $key ( keys %{$field} ) {
        print "\t $key --> ";
        print $field->{$key} if ( $field->{$key} );
        print "\n";
    }
    print "\n";
}

get_tables()

my $tables_ref = $sforce->get_tables();

foreach my $table ( @{$tables_ref} ) {
    print "$table\n";
}
print "\n";

SUPPORT

Please visit Salesforce.com's user/developer forums online for assistance with this module. You are free to contact the author directly if you are unable to resolve your issue online.

AUTHORS

Chase Whitener <cwhitener at gmail dot com>

VERSION INFORMATION

version 0.06 released 2006-01-19 - fixed documentation errors

version 0.05 released 2006-01-19 - original version; created by h2xs 1.23 with options -X -n WWW::Salesforce::Simple

version 0.04 released 2006-01-06 -fixed some documentation errors, made the module ready to be posted to CPAN

version 0.03 released 2005-10-31 -fixed some line length issues, added ability to change username and password by parameters to the constructor -username => '' -password => ''

COPYRIGHT

No Copyright