Closed (fixed)
Project:
Salesforce Suite
Version:
6.x-2.x-dev
Component:
sf_node
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 May 2012 at 16:37 UTC
Updated:
16 May 2012 at 12:50 UTC
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
Comment #1
texas-bronius commentedHmm.. 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 :)
Comment #2
kostajh commentedSorry, 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?
Comment #3
texas-bronius commentedThanks 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?
Comment #4
kostajh commentedThanks 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.
Comment #5.0
(not verified) commentedremoved red herring