Skip to content

Instantly share code, notes, and snippets.

@ktrusak
Created June 1, 2015 18:14
Show Gist options
  • Save ktrusak/e62b84d7d4122d59ea92 to your computer and use it in GitHub Desktop.
Save ktrusak/e62b84d7d4122d59ea92 to your computer and use it in GitHub Desktop.
<?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