The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

WWW::Salesforce::LeadConvertResult - A class to hold the return values of the "convertLead" in WWW::Salesforce method

DESCRIPTION

WWW::Salesforce::LeadConvertResult is a subclass of WWW::Salesforce::SObject. This is one of the complex types Salesforce returns from a method call.

SYNOPSIS

 use WWW::Salesforce;
 use WWW::Salesforce::LeadConvert;
 my $sforce = WWW::Salesforce->new();
 my $uinfo = $sforce->login( 'USER','PASS' ) or die $sforce->errstr;

 my $lc = WWW::Salesforce::LeadConvert->new(
    leadId => '0FQ30000009gBn8',
    convertedStatus => 'Closed - Converted',
 );

 my @lcrs = $sforce->convertLead( $lc, $lc, $lc, $lc ) or die $sforce->errstr();

 #loop through the LeadConvertResults
 for my $lcr ( @lcrs ) {
    print "convertLead for ", ($lcr->leadId()?$lcr->leadId():"invalid id"), " ";
    if ( $lcr->success() ) {
        print "passed!\n";
    }
    else {
        print "FAILED!\n";
        for my $err ( @{$lcr->errors()} ) {
            print $err->statusCode(), " ";
            print $err->message(), "\nOn Fields: ";
            print join ', ', @{$err->fields()};
        }
        print "\n";
    }
 }

METHODS

new HASH

Creates a new WWW::Salesforce::LeadConvertResult object. You shouldn't ever have to create this object on your own.

 my $lc = WWW::Salesforce::LeadConvertResult->new();

The following are the accepted input parameters:

leadId

REQUIRED - IDs are valid if: ^[a-zA-Z0-9]{15,18}$

opportunityId

IDs are valid if: ^[a-zA-Z0-9]{15,18}$

accountId

IDs are valid if: ^[a-zA-Z0-9]{15,18}$

contactId

IDs are valid if: ^[a-zA-Z0-9]{15,18}$

errors

String of errors

success

Boolean (1) true, (0) false

leadId ID
leadId

ID of the converted lead. IDs are valid if they pass ^[a-zA-Z0-9]{15,18}$

 $lc->leadId( 'D0000123anc00000CF' );
 print $lc->leadId();
opportunityId ID
opportunityId

ID of the new Opportunity, if one was created when "convertLead" in WWW::Salesforce was invoked. IDs are valid if they pass ^[a-zA-Z0-9]{15,18}$

 $lc->opportunityId( 'D0000000anc00000CF' );
 print $lc->opportunityId();
accountId ID
accountId

ID of the new Account (if a new account was specified) or the ID of the account specified when "convertLead" in WWW::Salesforce was invoked. IDs are valid if they pass ^[a-zA-Z0-9]{15,18}$

 $lc->accountId( 'D0000002anc00000CF' );
 print $lc->accountId();
contactId ID
contactId

ID of the new Contact (if a new contact was specified) or the ID of the contact specified when "convertLead" in WWW::Salesforce was invoked. IDs are valid if they pass ^[a-zA-Z0-9]{15,18}$

 $lc->contactId( 'D0000002anc00000CF' );
 print $lc->contactId();
success BOOLEAN
success

Indicates whether the "convertLead" in WWW::Salesforce call succeeded (true - 1) or not (false - 0) for this object.

 $lc->success( 1 );
 print $lc->success();
errors STATUS
errors

If an error occurred during the create() call, an array of one or more Error objects providing the error code and description.

 Select Id, MasterLabel from LeadStatus where IsConverted=true

 $lc->convertedStatus( 'Some status value' );
 print $lc->convertedStatus();
doNotCreateOpportunity BOOLEAN
doNotCreateOpportunity

Specifies whether to create an Opportunity during lead conversion (0, the default) or not (1). Set this flag to true (1) only if you do not want to create an opportunity from the lead. An opportunity is created by default.

 $lc->doNotCreateOpportunity( 1 );
 print $lc->doNotCreateOpportunity();
overwriteLeadSource BOOLEAN
overwriteLeadSource

Specifies whether to overwrite the LeadSource field on the target Contact object with the contents of the LeadSource field in the source Lead object (1), or not (0, the default). To set this field to true (1), the client application must specify a contactId for the target contact.

 $lc->overwriteLeadSource( 1 );
 print $lc->overwriteLeadSource();
sendNotificationEmail BOOLEAN
sendNotificationEmail

Specifies whether to send a notification email to the owner specified in the ownerId (1) or not (0, the default).

 $lc->sendNotificationEmail( 1 );
 print $lc->sendNotificationEmail();

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.

SEE ALSO

WWW::Salesforce by Chase Whitener

DBD::Salesforce by Jun Shimizu

SOAP::Lite by Byrne Reese

Examples on Salesforce website:

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_convertlead_leadconvertresult.htm

http://www.salesforce.com/us/developer/docs/api/index.htm

AUTHORS

Chase Whitener <cwhitener at gmail dot com>

COPYRIGHT

Copyright 2003-2004 Chase Whitener. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.