Created
June 1, 2015 18:14
-
-
Save ktrusak/e62b84d7d4122d59ea92 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action("gform_after_submission_23", "add_the_home_chapter", 11, 2); | |
function add_the_home_chapter( $entry, $form ){ | |
$id = gform_get_meta( $entry['id'], 'salesforce_id' ); | |
$chapter = $entry["34"]; | |
$api = GFSalesforce::get_api(); | |
$fieldsToUpdate = array ( | |
'home_chapter__c' => $chapter, | |
); | |
$sObject = new SObject(); | |
$sObject->fields = $fieldsToUpdate; | |
$sObject->type = 'Account'; | |
$sObject->Id = $id; | |
$sObject2 = ''; //For some reason SF always wants atleast 2 objects, no idea why.. | |
$response = $api->update( array( $sObject, $sObject2 ) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment