• Resolved zumajoe

    (@zumajoe)


    Hey there,

    Great plugin so far. If I can harness the filtering process then this solution will be in my opinion the best out there regarding synchronization of WP and SF.

    I’ve looked through all the documentation and comments here, however I’m still having trouble modifying the data that’s to be pushed to SF. In my instance, I need to take an image ID and convert that to a full url to store on the SalesForce side (since the image ID is useless outside of WP).

    Anyhow, this is my starting point – but when I test this within functions.php, all pushes to SF stop working and I’m not seeing any errors.

    Any clues?

    add_filter( 'object_sync_for_salesforce_push_params_modify', 'modify_values', 10, 6 );
    function modify_values( $params, $mapping, $object, $sf_sync_trigger, $is_new ) {
    
        $new_value = "modified filter value";
        $params = array(
            'my_acf_field' => $new_value,
        );
    	return $params;
    }
    

    Thanks!

    • This topic was modified 4 years, 8 months ago by zumajoe.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jonathan Stegall

    (@jonathanstegall)

    This hook is documented here. You’ll notice that the $params array has a lot more going on than your example.

    If it’s not clear how to use it, I recommend doing error_log( print_r( $params, true ) ); to see how the array is structured before doing more work with the filter.

    While we don’t really do more support for the hooks than what the documentation offers, I do think that could point you in the right direction.

    Thread Starter zumajoe

    (@zumajoe)

    Hi Jonathan,

    Your suggestion with the error_log printing was very helpful, I appreciate you pointing me in the right direction with that.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Filtering / Modifying Push to SalesForce data’ is closed to new replies.