Created
March 7, 2025 20:22
-
-
Save jodzeee/624d7641156d1a332b1296e020c9cd10 to your computer and use it in GitHub Desktop.
Send child entries to Salesforce
This file contains hidden or 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 | |
// Change 36 to your parent form ID | |
add_action( 'gform_after_submission_36', function( $entry, $form ){ | |
global $vxg_salesforce; | |
$parent_entry = new GPNF_Entry( $entry ); | |
$child_entries = $parent_entry->get_child_entries( 25 ); // Change 25 to the Nested Form field ID in the parent (FIELD ID, NOT FORM ID) | |
foreach ( $child_entries as $child_entry ){ | |
$child_form = GFAPI::get_form( rgar( $child_entry, 'form_id' ) ); | |
$vxg_salesforce->push( $child_entry, $child_form ); | |
} | |
}, 10, 2 ); | |
// Change 31 to your parent form ID | |
add_action( 'gform_after_submission_31', function( $entry, $form ){ | |
global $vxg_salesforce; | |
$parent_entry = new GPNF_Entry( $entry ); | |
$child_entries = $parent_entry->get_child_entries( 31 ); // Change 31 to the Nested Form field ID in the parent (FIELD ID, NOT FORM ID) | |
foreach ( $child_entries as $child_entry ){ | |
$child_form = GFAPI::get_form( rgar( $child_entry, 'form_id' ) ); | |
$vxg_salesforce->push( $child_entry, $child_form ); | |
} | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment