Description
The gf_salesforce_object_request_path
filter allows developers to customize the request path used to fetch Salesforce Object Types in the feed creation dropdown for the Gravity Forms Salesforce Add-On, to limit or modify the displayed object types.
Usage
add_filter( 'gform_salesforce_object_request_path', 'your_function_name', 10, 1);
Parameters
- $object_request_path string
The object name that’ll be passed to query the Object Type dropdown.
Examples
Appends An Object To The Request Path
This example appends Test_Object__c to the request path used to fetch Salesforce object types. This limits the dropdown to display only the specified object type (Test_Object__c). The object is obtained from the Salesforce Object Manager > API Name column.
add_filter( 'gform_salesforce_object_request_path', 'modify_salesforce_request_path', 10, 1 );
function modify_salesforce_request_path( $object_request_path ) {
$form_id = rgget( 'id' );
$modified_request_path = $object_request_path . '/Test_Object__c';
$modified_request_path = gf_apply_filters( array( 'gform_address_street', $form_id ), $modified_request_path, $form_id );
return $modified_request_path;
}
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Since
This filter was added in Salesforce version 1.0.0
Source Code
This filter is located in class GF_Salesforce in includes/api/class-gf-salesforce-api.php