You need to sign in to do that
Don't have an account?
jdevia
How to populate sObject
Hi, following the sForce_API PDF, and trying to execute the CREATE call sample. I can't find a way to understand this line:
sObject[] records = new sObject[] {account};
I can´t understand the "... = new sObject[] {account};", how is the way to be done??
On my code source i have this on this way:
pruebaCreacionFeb3V1.sforce.SaveResult saveResults = ??????;
How do i populate the sobject array??
Thanks
(C#.net & Enterprise.wsdl)
sObject[] records = new sObject[] {account};
I can´t understand the "... = new sObject[] {account};", how is the way to be done??
On my code source i have this on this way:
pruebaCreacionFeb3V1.sforce.SaveResult saveResults = ??????;
How do i populate the sobject array??
Thanks
(C#.net & Enterprise.wsdl)
Message Edited by jdevia on 02-03-2006 08:09 AM
saveResults is another object which is the return type from methods of the SforceService class.
If what you are trying to do is query your SFDC then you want to look at query method which returns a QueryResult object. the saveResult object is returned from updates and creates (in APIv7 you might want to investigate the new upsert method)
Perhaps you would be better to start with the Enterprise API rather than the partner one. A lot of the complextity that you are experiencing is caused by the flexibility of the P-API which is needed to cross customisation boundaries. The E-API hides this in a way that you may find more efficient for your needs.
This thread (3072) has a good discussion
Hope that helps, good luck
Gareth
Message Edited by Gareth Davies on 02-03-2006 09:13 AM
See the .Net samples for complete examples.
this is the API sample:
sObject[] records = new sObject[] {account};
And this is my code:
pruebaCreacionFeb3V1.sforce.sObject records = new pruebaCreacionFeb3V1.sforce.sObject {account};
My problem is how do I add the account to the RECORDS array??
And it shows this error:
A new expression requires () or [] after type over the { & } characters..
Message Edited by jdevia on 02-03-2006 08:48 AM
sObjects[] records = new sObjects[] {account}
---- I just compiled this to check for you
sObject obvious = new sObject();
sObject [] collection_of_obvious = new sObject[] {obvious};
And this is the correct syntax.
Message Edited by Gareth Davies on 02-03-2006 09:09 AM