• Resolved ngabo12

    (@ngabo12)


    Let me first say that this is an awesome plugin.

    I have successfully connected Salesforce to wordpress but I kindly need help to Pull salesforce calendar fields(see below) to WordPress Tribe Events Plugin.

    Here are the fields:

    /services/data/v44.0/query/?q=SELECT+id+,+ EventApi__Display_Name__c +,+ EventApi__Start_Date_Time__c +,+ EventApi__End_Date_Time__c +,+ Type__c +,+ Event_URL__c +,+ EventApi__Status__c +from+ EventApi__Event__c +where+ EventApi__Status__c +=+’Active’

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author Jonathan Stegall

    (@jonathanstegall)

    I haven’t used that plugin, and certainly Object Sync for Salesforce does not support all third party plugins. Here’s what I can tell you, though:

    First, I’d recommend that you review the FAQ in this plugin directory and see if any of the instructions around mapping custom fields are relevant for you. Many custom plugins will work with this plugin, especially if they work with default WordPress methods of storing data.

    But certainly there are many plugins where this is not the case. If you can’t map the fields that your plugin uses with the default plugin behavior, you can certainly use the developer hooks to do a lot more. There is some documentation about all of the developer hooks; it’s included when you download the plugin.

    We don’t really provide support for the developer hooks unless there are bugs; you’ll have to review the documentation and do what you can from there.

    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    Also there was one earlier support forum request about your particular plugin and mapping date fields. You can read about that here.

    Thread Starter ngabo12

    (@ngabo12)

    Thanks Jonathan, I am going through all you have recommended.
    Just a quick question, Which events calendar easily syncs with Salesforce?

    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    I don’t have any detailed advice on this. I have done some basic testing with this plugin integrating with The Events Calendar, but again pretty basic.

    Thread Starter ngabo12

    (@ngabo12)

    Thanks Jonathan for all the help.

    I figured all out when I changed to use all in one events calendar..

    The first time the events got pulled into wordprress from salesforce as drafts. So I changed the field maps and deleted the draft events in wordpress.

    Then now I get this in debug>> https://imgur.com/a/Xlo7cWB
    But the events are not showing anywhere,

    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    I think it’s probably because you deleted the events from WordPress. Now, when the plugin checks Salesforce for new data, it thinks those events have already been processed.

    If you want to verify that, that is what your debug message is good for. It shows you the query it’s running against the Salesforce API. You could run that query in the Salesforce developer console, for example, and see if it returns any results.

    But it’s very likely that it thinks those rows have already been processed. You might need to add new ones to Salesforce for it to process.

    Also, some people use a developer hook to cause the drafts to be set to publish. Like this:

    add_filter( ‘object_sync_for_salesforce_pull_params_modify’, ‘change_pull_params’, 10, 6 );
    function change_pull_params( $params, $mapping, $object, $sf_sync_trigger, $use_soap, $is_new ) {
    $params[‘post_status’] = ‘publish’;
    return $params;
    }

    You could also do it by mapping a custom field in Salesforce with a value of “publish” to post_status.

    Thread Starter ngabo12

    (@ngabo12)

    Thanks, using the developer hook worked..

    Now I am left with the issue of mapping the saleforce event date to match the ai1ec events date. There is no object for ai1ec events date and I am wondering how easily I can create the objects

    Thread Starter ngabo12

    (@ngabo12)

    Hello. Everything worked but now, I cant see the events under the event tab but it shows the number of events present and no events

    Thread Starter ngabo12

    (@ngabo12)

    one last question, I am having a problem when Object Sync plugin creates events, the post status is set to 1 instead of publish. Meaning events dont show but show in the database

    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    I think I pasted an old version of that developer hook’s usage. You should be able to do it like this instead:

    add_filter( ‘object_sync_for_salesforce_pull_params_modify’, ‘change_pull_params’, 10, 6 );
    function change_pull_params( $params, $mapping, $object, $sf_sync_trigger, $use_soap, $is_new ) {
    $params[‘post_status’] = array(
    ‘value’ => ‘publish’,
    ‘method_modify’ => ‘wp_update_post’,
    ‘method_read’ => ‘get_post’,
    );
    return $params;
    }

    That is the up to date syntax, I believe. If it still gives you trouble, again, you could instead create a field in Salesforce with a value of “publish” and map it to your WordPress field. But I think the hook will work if you do that.

    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    Now to be clear, you’ll also want to make sure you’re doing that to the correct post type. As I pasted it, it would work on any post types you were mapping and you may not want to do that.

    If you have trouble customizing it more than that, you may just want to map the custom field. We don’t provide much support for the developer hooks, as they’re intended for developers.

    Thread Starter ngabo12

    (@ngabo12)

    Thanks for the quick reply Jonathan. I used the developer hook and it worked at first. Now whenever events(Tribe Events) are created the post status is set to “1” even when in the object there is “Post_status” set to “..Is Published”

    See what PHPMyadmin shows, https://imgur.com/a/6yup42D and when i change post_status = publish, all events show

    Also when I put the developer hook:

    add_filter( ‘object_sync_for_salesforce_pull_params_modify’, ‘change_pull_params’, 10, 6 );
    function change_pull_params( $params, $mapping, $object, $sf_sync_trigger, $use_soap, $is_new ) {
    $params[‘post_status’] = array(
    ‘value’ => ‘publish’,
    ‘method_modify’ => ‘wp_update_post’,
    ‘method_read’ => ‘get_post’,
    );
    return $params;
    }

    I get an error: PHP Warning: Use of undefined constant ‘object_sync_for_salesforce_pull_params_modify’ – assumed ‘‘object_sync_for_salesforce_pull_params_modify’’ (this will throw an Error in a future version of PHP) in /home/tb8fd5jhp/public_html/wp-content/themes/Avada/functions.php on line 74

    Line 74 is $params[‘post_status’] = array(

    Thread Starter ngabo12

    (@ngabo12)

    Update: I deleted the field WordPress(Post_status) = is published(salesforce) then the events started showing up again. But the events show up as drafts yet I didnt check Pull as draft

    Thread Starter ngabo12

    (@ngabo12)

    PHP logs say the error is within: add_filter( ‘object_sync_for_salesforce_pull_params_modify’, ‘change_pull_params’, 10, 6 );

    Hey guys, I am trying to use an object sync for salesforce and I’m figuring out how to use the plugin on the events calendar. Does anyone have any possible suggestions on what can be done to solve for this?

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Pull salesforce calendar fields to WordPress Tribe Events Plugin’ is closed to new replies.