如何添加多个产品以在Salesforce中创建一个机会?

时间:2013-12-12 16:04:34

标签: php salesforce crm

我有这个代码片段,目前正在从Drupal页面向Salesforce添加一个带有一个产品的Opportunity。现在问题是我想在用户同时选择多个产品后创建一个包含多个产品的机会。

    $fields = array(
        'Name' => 'Adhesion - ' . $field_nom_adhesion . ' ' . $field_prenom_adhesion,
        'Pricebook2Id' => 'sr3sdfxcvbwqe',
        'AccountId' => $AccountId_Con,
        'CloseDate' => $today,
        'StageName' => 'Proposition/Devis',
        'Cat_gorie_produit__c' => 'Adhésion',
        'Source__c' => 'Site web',
        'Statut_Adhesion__c' => str_replace("\'", "'", $field_statut_adhesion),
        'Contact__c' => $ContactId_Opp
    );

    $sObject         = new SObject();
    $sObject->fields = $fields;
    $sObject->type   = 'Opportunity';

    $sObject2         = new SObject();
    $sObject2->fields = $fields;
    $sObject2->type   = 'Opportunity';

    echo "<br/>**** Creating the following:\r\n";
    $createResponse = $mySforceConnection->create(array(
        $sObject
    ));

0 个答案:

没有答案