You need to sign in to do that
Don't have an account?
Question on "Create"
I'm trying to create a new contact. Im confused as to how the create call knows that I am attempting to create a new contact as opposed to creating a new account.
result = sfdc.create(sObjects) <-- that's my call for the create -->
I am getting the following error:
Web service operation "create" with parameters {[[contact1.setlastName("St. Martin"), contact1.setphone("509-555-8302"), contact1.setfirstName("Duane"), contact1.setaccountID("00130000003mZ6ZAAU")]]} could not be found.
Have I built my Array incorrectly?
Velvett
Message Edited by Velvett Fogg on 12-01-2004 10:27 AM
Message Edited by Velvett Fogg on 12-01-2004 10:31 AM
Hi, uh, Fogg,
Help me help you. How do you create your array? What language are you using?
Using the enterprise wsdl, the soap stack serializes each contact into an SObject. When this happens, an type attribute is also generated for the SObject indicating what concrete type is represented by the SObject.
Using the partner wsdl, you actually specify the type in the type field of the SObject.
Using ColdFusionMX
<cfscript>
sObject[1]=contact1.setlastName("St. Martin");
sObject[2]=contact1.setphone("509-555-8302");
sObject[3]=contact1.setfirstName("Duane");
sObject[4]=contact1.setaccountID("00130000003mZ6ZAAU");
result = sfdc.create(sObjects);
</cfscript>
There's my code. That generates the error I pasted in my first post.
Thanks much for your help Dave
PS Any chance that ColdFusion gets it's "own" forum? like PHP has?
Velvett
Hi Fogg,
So, not knowing much about cold fusion,
It looks like you have a 4 element array - sObject, that you are setting all to the same contact, and whilst setting each element to the contact you are setting properties on the contact. Then passing a variable named sObjects (not the plural versus the singular on the array) to the create command.
Am I interpreting this correctly? If so, it doesn't look right.
I would think it would go something like this:
contact1.setlastName("St. Martin");
contact1.setphone("509-555-8302");
contact1.setfirstName("Duane");
contact1.setaccountID("001300000003m...");
sObject[1] = contact1;
result = sfdc.create(sObject);
??
That's what my Array "looks" like.
I am calling result = sfdc.create(sObjects);
I get that same error.
Sorry for being difficult.
Velvett
Message Edited by Velvett Fogg on 12-01-2004 04:20 PM
Hi Fogg,
Well, I'm out of ideas. We really need a coldfusion person to chime in here.
Thanks for trying Dave. I spent most of yesterday researching this, and I think the trouble may be with the way CF handles Arrays. If I come across a solution, I'll post it on these forums so that others can take advantage.
Velvett
Thanks Fogg,
I guess I need to learn yet another development environment!
i am not much of an expert with sForce but i use CFML/Java all day. I think whatever you want to do can be done in CFML.
can you give me a bit more detail as to what format you need to data to be in?
the example I saw was a structure with an array. is this correct or do you need to have to array alone?
thx.
jc
JC,
Since posting this I've done some research. It seems that CF does not pass it's array's properly. I have been told that I will have to use CF to call a Javaobject in order to make this work. I've not done much with it after I found that out.
Fogg