function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SeattleEliSeattleEli 

Possible to execute account ownership edit via API

I'm trying to determine if there is any way to execute the online Account ownership edit logic without coding a duplicate of the logic in our account integration program (we use Java).

Here's the situation: We have an integration program that inserts and updates accounts via Java and the Sforce API. This is required to synchronize accounts in SFDC with our accounts system of record. When our program updates an account owner, only the account owner gets changed. However, there are numerous related lists that do not get updated with the new owner of course. If you use the web interface to change an account owner, SFDC automatically changes owners on the related list.

In particular, This is what the web interface states will happen when I try to change ownership of an example account:

"When you transfer ownership of an account, the new owner will also gain ownership of the following records related to the transferred account:
⬢ all notes and open activities for this account owned by User X
⬢ all contacts within the account owned by User X, including all related notes and open activities owned by User X
⬢ all opportunities (including closed opportunities) within the account owned by User X, including all related notes and open activities owned by User X"

THE BIG QUESTION: Is there some way through the API that I can issue an ownership change and trigger this logic that already exists in SFDC? Or is my only option to code all of that logic. It gets hairier (and more costly from a performance perspective) than it first appears. For example, you can't just get all of the related objects to the account that fit the ownership and status criteria and change their owner. You have to recurse through those related objects (contacts for example) and change all of the appropriate notes and activies related to those contacts... etc. That is going to be a potentially overwhelming number of Sforce API calls. And many of the queries for the possible related objects on contacts for example will return no results. But we have to make them on every contact because we don't know if there are related objects or not without querying.

If the only option is to code this logic myself, can we get the logic being executed in this behavior from SFDC to ensure that our logic matches the behavior that exists through the web interface?

Thanks,
Eli

Message Edited by SeattleEli on 10-06-2005 10:15 AM

DevAngelDevAngel

Hi SeattleEli,

There is not any way in the current API implementation to have the ownership change bubble to the all the related objects. 

The following is not an officially supported api.  Salesforce.com reserves the right to change the name of any field on a form at any time.  

You may be able to simulate the form post that is done when using the ui.  This would require analyzing the change ownership form and creating the appropriate post data then posting to the /setup/own/entityowneredit.jsp page.

Using firefox you can inspect this form easily.

 

Message Edited by DevAngel on 10-11-2005 09:39 AM

benjasikbenjasik
Just want to add a note that building an integration like this is not supported. It will work, but from release to release, we do not guarantee that form parameter names will not change.
Rick.BanisterRick.Banister
This would be easy and painless if you did it in a database and replicated the changes to Salesforce. My company sells a database integration product, Relational Junction for Salesforce, that allows 2-way synchronization between your Salesforce org and a local database (Oracle, SQLServer, MySQL, or Sybase). Since the database is an exact copy of your Salesforce org, what you would do is to update all the related records in the database and then let replication send that back to Salesforce.

You can contact me directly at Rick.Banister@sesamesoftware.com or visit http://www.sesamesoftware.com to download documentation or request a product demo. This is a very pain-free and automated product which could have you a replication warehouse in minutes with no design work.