You need to sign in to do that
Don't have an account?
Creating a Custom Object via the Office Toolkit
Hi all
We’ve recently started using the OfficeToolkit for some in-house development. We’re developing an application that implements some interactions between excel and salesforce. This application creates a new custom object using a combination of data generated by salesforce and data generated by our excel file.
Strange as this may sound, a few weeks ago we downloaded the office toolkit (version 3 which I think is the newest one) and started implemented our application. We were easily able to create standard objects like Accounts, Contacts, etc using the samples provided in the office toolkit developers guide. We were also able to create a custom object using the toolkit.
However, as of today, the code no longer works. We can still create standard objects but we can no longer create custom objects via the toolkit. When we try to create one of our custom objects we receive the following error – “One of the records in the batch call resulted in an error. Examine the records to determine which one(s) failed”.
The code hasn’t changed in the past two weeks and I’ve checked the permissions to ensure I have appropriate rights to create an object. I had another look at the office toolkit developer guide and noticed the following statement regarding custom objects - “Client applications cannot Create custom objects via the API. However, client applications with sufficient permissions can invoke API calls on custom objects.” I take it this means we cannot create custom objects via the office toolkit? If so, I don’t know why we were able to do this successfully two weeks ago and not today? I don’t think I’m loosing my mind :-( Any insights into our problem would be greatly appreciated.
Our code hasn’t been changed in the past two weeks, I haven’t upgraded/re-installed the toolkit in the past two weeks and the references are setup to point to the SForceOfficeToolkitV3. If the toolkit has been updated and this functionality is simply not supported anymore – are there any workarounds or alternatives that you guys could suggest? I’ve included some code snippets to illustrate how we’re creating the custom object below.
Thanks,
Karen
'create using batch call
Dim so(0) As SObject3
Set so(0) = g_sfApi.CreateObject("proposal__c")
Dim oppid As String
oppid = ………. //We take this from salesforce
'set the values of the proposal to the appropiate cell values
so(0)("Opportunity__c") = oppid
'call batch method
g_sfApi.Create so, False
'call batch refresh
g_sfApi.Refresh so, False
Humm. I’m not sure where in the doc you read that you can’t create custom objects via the api, as you most certainly can.
You need to get the specific error message. To do this look at:
So(0).ErrorMessage
It will have the detailed error.