+ Start a Discussion

Problem creating document because of DeveloperName

We recently ran into a problem when we create a document via the api when the document name is the same. The error we are getting is

"Create Failed: DUPLICATE_DEVELOPER_NAME: This Document Unique Name already exists.  Please choose a unique name. -- DeveloperName"

I thought that specifying the DeveloperName on the document object would be enough, but when I try that, the error I get is

"Create Failed: INVALID_FIELD_FOR_INSERT_UPDATE: Document: bad field names on insert/update call: DeveloperName -- DeveloperName"

This seems a bit contradictory. Any help would be greatly appreciated. Thanks!
Not sure if this is related but the apexdevnet.com site seems to have a similar issue...
When I attempt to access the initial PDF download page, I get pushed to this URL (depsite having just logged in to force.com)
and this error (on a page complete with what looks like a "non-configured" logo):
"Database error
A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:
(SQL query hidden)
from within function "User::addToDatabase". MySQL returned error "1062: Duplicate entry '{my name} ({my name)' for key 2 (localhost)".

Message Edited by mark_s on 12-03-2008 11:07 AM
I don't think that your problem is related. I am trying to create a document in the Salesforce document library using the API.
Fair enough. I just thought it seemed like a similar system error.
Presuming that the Salesforce systems are built upon their own framework it might suggest that the underlying method in the database (not exposed via the API) is at fault

good luck



I also want to create documents in Salesforce using the API.  I am new to SalesForce and am not getting enough information on how to be able to do that.  Can you let me know how are you proceeding with it.  



documents work just like all the other data types (for which there are examples in the docs). Assuming you're using the enterprise api, create a document object, set the properties, pass it to the create method, check the returned SaveResult.



Can you add any input to the original question?




We are still having problems with this error. If anyone can help, it would be greatly appreciated.

Murthy vvrMurthy vvr


      Did you get any solution to this problem ?????





I believe the only solution, unfortunately, is to catch this exception and retry the request after a short wait.
Murthy vvrMurthy vvr



        Thank you for the solution. But is there any exact time limit ???



No. This is just a work around to the problem and not a true solution. I believe that Salesforce needs to provide a long term solution to this.