Hi - Superb module suite. I think you've baked in just about everything, and it .. just works!

I am looking to keep a sort of "Draft" state on a node until explicitly Submitted to SFDC. To me, this sounds like "disable automatic sync" on create/update, and add in button via form alter to set my node's draft state per whatever that means to me internally and then fire off sf_node_export($node, $salesforce->name, $salesforce->sfid); directly. Any thoughts on whether this is the best way to go about it?

Thanks!
-Bronius

Comments

texas-bronius’s picture

Title: Without sf_queue enabled and with Automatically sync on Create and Update checked, why might the update not happen automatically » Please advise on how best to hook into manually fired off export to SFDC request

Hmm.. My initial post title and confusing part of the issue was a fluke: I just tested again and my sync did indeed fire on nodeapi -> $op == "update". First part of question still stands :)

kostajh’s picture

Status: Active » Postponed (maintainer needs more info)

Sorry, I'm not clear on what exactly you are looking for. Can you try rewording your question?

Have you looked at the pre_export hook?

texas-bronius’s picture

Thanks for your quick reply! You're right: my question was pretty confusing.

I would like a user in my system to be able to create a draft (node create) and save and edit it before sending it to Salesforce.com. Once satisfied with the draft node, she should then be able to click a new link or button ("Submit for Approval") which only then invokes the node export to SFDC sync. In addition to calling the export routine (I presume by calling sf_node_export() directly), I would also like to flip the status (a cck field on that node) to "Submitted".

I think hook_salesforce_api_pre_export is a good reminder, but not certain it's the best place for this: My implementation with hook_..pre_export would have to be:
- _pre_export checks status node->submitted == FALSE, return false (prevent export)
and something somewhere would then have to node->submitted = TRUE before the next node save in order for hook..pre_export to detect and proceed.

Thoughts? Is that clearer?

kostajh’s picture

Status: Postponed (maintainer needs more info) » Fixed

Thanks for clarifying. I think you would want a custom module that implements hook_nodeapi, and on the 'update' op checks for your conditions (e.g. 'Submit for approval' is checked), and then call sf_node_export(). You are right, you will want to disable the automatic export option for the fieldmap.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

removed red herring