• foghorn
  • NEWBIE
  • 245 Points
  • Member since 2004

  • Chatter
    Feed
  • 2
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 148
    Replies

Hi,

 

Can somebody explain why these work:

SELECT Id FROM object__c WHERE Id = 'asdf'

 

and

 

SELECT Id FROM object__c WHERE myField__c LIKE '%asdf%'

 

but this doesn't:

 

SELECT Id FROM object__c WHERE Id = 'asdf' OR myField__c LIKE '%asdf%'

  • March 11, 2010
  • Like
  • 0

I was told that when I signed up as a developer, I would have access to a demo database.

I was told that I would use my logon user name and password to logon to Sales Force.

 

I copied the VB code from the PDF and appears to work, but I am getting an error:

 

"Invalid username, password, security token; or user locked out."

 

I assume the User name and/or password is not the correct one to use.

 

I did use WireShark to confirm Internet traffic was occuring when trying to login.

 

Any help would be appreciated,

Ira

  • January 18, 2010
  • Like
  • 0
http://www.chopkinspower.com/bin/setup.exe (please ignore the lame url!)

I thought it would be a good idea to start posting up some of the sample code I have laying around for how to use the OfficeToolkit in various platforms.

The first one (this one) is a c# project that performs a bulk mail merge using the app exchange api.

The mail merge bit is pretty much the production mail merge code renamed and reworked a little and is also included (vb 6).

As a bonus, if you install the salesforce offline edition from

https://na1.salesforce.com/setup/offline/offline2setup.jsp

you can see how to use the offline api to generate your merge results, but please do not call salesforce support if you have a problem, it is not an official salesforce product.

The projects are installed to

prog files\salesforce.com\Bulk Mail Merge

comments are always welcome!
http://www.chopkinspower.com/bin/setup.exe (please ignore the lame url!)

I thought it would be a good idea to start posting up some of the sample code I have laying around for how to use the OfficeToolkit in various platforms.

The first one (this one) is a c# project that performs a bulk mail merge using the app exchange api.

The mail merge bit is pretty much the production mail merge code renamed and reworked a little and is also included (vb 6).

As a bonus, if you install the salesforce offline edition from

https://na1.salesforce.com/setup/offline/offline2setup.jsp

you can see how to use the offline api to generate your merge results, but please do not call salesforce support if you have a problem, it is not an official salesforce product.

The projects are installed to

prog files\salesforce.com\Bulk Mail Merge

comments are always welcome!

 

I am in the public sector/government business and we are developing an application on force.com. we need to generate huge proposal documents (300 to 500 pages long) and the content is derived form the custom objects in our applications.  Transaction system would have captured all the data elements, which needs to be connected to infer some of the briefing outputs. I tried s-docs and has issues after 20 pages.

 

Appreciate you sharing ways to generate documents like, word, excel and powerpoint, using a template or not.

I am attempting to use the DescribeSOBjects using the office toolkit vs. 4.0, and cannot seem to get this to work properly.

 

Does anyone have some good examples of how to use this method in the VBA editor?

 

Thanks.

 

Private Sub GetSObjects_Click()

    Dim Username As String
    Dim Password As String
    Username = "user@user.org"
    Password = "password"

    Dim sfSession As SForceSession4
    Set sfSession = New SForceSession4
    
    Dim dsr() As String
    If sfSession.Login(Username, Password) Then
        dsr = sfSession.DescribeSObjects( "Account")
    Else
        MsgBox "Invalid Login"
    End If

End Sub

 

When I run the above line I get an error saying Expected Function or Variable

 

Even when I change dsr = sfSession.DescribeSObjects( "Account") to

 

sfSession.DescribeSObjects( "Account"

 

I still get an error saying: Array passed to DescribeSObject needs to be of type VT_BSTR or BT_VARIANT.

 

Any help would be appreciated.

 

Thanks.

 

Hello,

 

I am trying to develop my own Excel-report-tool.I use the Office Toolkit for the communication with Salesforce. But if I try to send the query:

 

SELECT AccountNumber 

FROM Account

WHERE id in (SELECT ..........)

 

I get the error message, that semi joins are not supported in this API version. I checked it, and the toolkit uses the API 15.0. In the newer versions (I used 20.0) this query is possible.

 

Is there an easy possibility to use the latest API? I do not want to write my own .dll.

 

Thanks in advance

Markus

  • December 29, 2011
  • Like
  • 0

We are using the Office Toolkit (Version 4.0) to interface with the Salesforce data (API). We are successfully retrieving data from various tables but can not access the quote table and quote line items. We receive the following error:

~~~~~~~~~
SForceOfficeToolkit4.SQueryResults4.1 error '80004005'

INVALID_TYPE: sObject type 'quote' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.
~~~~~~~~~

When we append the '__c' to custom fields we still receive an error. The WSDL does not provide a solution and various posts to the forum refer to the same problem but so far we do not see an answer posted.

Can someone please tell us how we can access the quote object using Office Toolkit (Version 4.0)? We do have quotes enabled for the organization. If there is any question about API version can you please tell us where to find this in the Office Toolkit?

  • December 09, 2010
  • Like
  • 0

Okay, I'm new here, spent the last 5 hours going in circles just trying to find the Office toolkit and dlls.  I can find the manuals and references to go to the developers home page and download the toolkit, but I can not find it anywhere and most references to links I'm finding are dated 2006-2007.

 

What I'm ultimately trying to accomplish is this:    I have a macro enabled Word document with an extensive application written in Visual Basic for Applications that generates proposals.  It is currently installed on a users PC as a standalone Word document with a collection of Word document templates that are converted into a final proposal document merged with users contact information and clients contact information.

 

I want to integrate my existing VBA application with SalesForce.com to pull in contact information from SalesForce.com and output our assembled proposals in a way/location that works with SalesForce.com

 

The development environment for our VBA application is Microsoft Visual Basic for Applications 7.0 (the Office 2010 version however it works with versions back to Office 2002).   Also ours works with both the 32-bit and 64-bit versions of Office 2010.  Does Salesforce.com's Office Toolkit support the new Office 2010 32-bit and 64-bit?

 

I have found references to an older Office Toolkit with a demo that sounds like it along the lines of what I'm doing.  Is there a link to that demo (it was described in a 2007 support posting as a Word document with a macro that shows how integrate with Salesforce)? 

 

I can not find any links or ways to download or install the "Office Toolkit" from either my developer login, or my force.com login in the Setup area.   All I can find is the Office Toolkit manual.

 

How do I get started?

 

Ian

Hi All,

I have gone through all of the posts on this board and have been unable to determine what my issue is.  I am using the below code to test the login but I keep getting invalid user name, password or token.  The user is set up to not have a token assigned through api and is working fine for all other apps we have running. 

 

Note I have removed the user id and password and just attached the code:

 

My question is two - fold:

1.  Do I need to have the excel connector installed to use the office toolkit API?

2.  Is there anything you can see that is wrong with the code below?

 

*******************************************************************

Dim g_sfApi As SForceOfficeToolkitLib3.SForceSession3
Public LoginTest As Boolean
Public myusername As String
Public mypassword As String
Public myserverurl As String
Public mymessage As String

Sub MyMain()
    LoginTest = True
    If LoginTest = True Then
        myusername = "
        mypassword = ""        'this might be different from below
        'mypassword = "password + token"        'this might be different from below
        myserverurl = "https://test.salesforce.com/services/Soap/c/17.0"
    Else
        myusername = ""
        mypassword = ""        'this might be different from above
        myserverurl = "https://www.salesforce.com/services/Soap/c/17.0"
    End If
     
If SampleLogin(myusername, mypassword) = True Then
    mymessage = "Logged into: " & g_sfApi.ServerUrl
    MsgBox mymessage
    'CreateAccount
Else
    mymessage = "Login failed, " & g_sfApi.ServerUrl & g_sfApi.ErrorField & g_sfApi.ErrorMessage
    MsgBox mymessage
    MsgBox (g_sfApi.ErrorField & g_sfApi.ErrorMessage)
    'Unload Me
End If

End Sub

Public Function SampleLogin(Username, Password) As Boolean
    Set g_sfApi = New SForceOfficeToolkitLib3.SForceSession3
    Debug.Print "Default URL: ", g_sfApi.ServerUrl
   
    If LoginTest = True Then
        g_sfApi.SetServerUrl (myserverurl)
        Debug.Print "New URL: ", g_sfApi.ServerUrl
    End If

    SampleLogin = g_sfApi.Login(Username, Password)
End Function

********************************************************************************

 

Thank you,

 

 

Hi all,

 

From what I can tell, the difference between and organization user login and a customer portal login via the API is ...

 

- The organization user must have a security token appended to the password value

- The customer portal user needs to supply organizationID and portalID values in the LoginScopeHeader

 

I cannot determine any way to supply those header values using the Office Toolkit library though, so is it simply not possible to log in as a customer portal user via the Office Toolkit?

 

As an experiment, I did try using the SetSoapHeader function to set those headers, but the login was not successful.  I tried it using "LoginScopeHeader" as the section argument and also using "LoginScope" as the section argument.

 

If the Office Toolkit can't do this job, then does anyone have a recommendation regarding the easiest alternative means of accessing the WS API from VBA and legacy VB6 code?

 

Thanks,

 

- Steve J.

  • March 29, 2010
  • Like
  • 0

Hi,

 

Can somebody explain why these work:

SELECT Id FROM object__c WHERE Id = 'asdf'

 

and

 

SELECT Id FROM object__c WHERE myField__c LIKE '%asdf%'

 

but this doesn't:

 

SELECT Id FROM object__c WHERE Id = 'asdf' OR myField__c LIKE '%asdf%'

  • March 11, 2010
  • Like
  • 0

I was told that when I signed up as a developer, I would have access to a demo database.

I was told that I would use my logon user name and password to logon to Sales Force.

 

I copied the VB code from the PDF and appears to work, but I am getting an error:

 

"Invalid username, password, security token; or user locked out."

 

I assume the User name and/or password is not the correct one to use.

 

I did use WireShark to confirm Internet traffic was occuring when trying to login.

 

Any help would be appreciated,

Ira

  • January 18, 2010
  • Like
  • 0

I read somewhere in the community that the Opportunity's stage history is read-only for API purposes.  For that I just wanted to confirm whether or not I can import stage history from an old instance of SF to a New instance, or is it like Field History where it is disallowed?

 

Thanks for any feedback!!

  • January 11, 2010
  • Like
  • 0

This SQL works fine with Office Toolkit v3, but not v4:

 

select * from Billing_CCPayment__c
WHERE Status__c = 'Unsuccessful'
AND Payment_Process_Date__c >= 2009-04-03
AND Payment_Process_Date__c <= 2009-04-03T23:59:59-05:00

 

In v4, I get this error:

 

SForceOfficeToolkit4.SForceSession4.1 (0x80004005)
INVALID_FIELD: Status__c = 'Unsuccessful' AND Payment_Process_Date__c >= 2009-04-03 ^ ERROR at Row:1:Column:373 value of filter criterion for field 'Payment_Process_Date__c' must be of type dateTime and should not be enclosed in quotes

 

It appears that my dates/times are formatted as per the v4 documentation.  Payment_Process_Date__c is specified as a date/time field in Salesforce. 

 

Has something changed with the 'where clause' syntax - or with date formatting syntax?

 

Thanks for helping.

 I need to create reports in the offline version.

 

Is there a way to access the the offline line data via the XML API or other means with i.e. Crystal Reports?

Running Office 2007 and Vista, anyone else had problems with fields not populating correctly?  I add a merge field to my document using the office connector and it appears to be the correct field, but populates the field with wrong data or no data?
 
Sample of my template:
<<ACCOUNT_NAME>>
<<ACCOUNT_BILLINGSTREET>>
<<ACCOUNT_BILLINGCITY>>
<<ACCOUNT_BILLINGSTATE>>  <<ACCOUNT_BILLINGPOSTALCODE>>
 
PHONE:  <<ACCOUNT_PHONE>>
FAX:        <<ACCOUNT_FAX>>
(other account details here in header section of page)
 
CONTACTS:
NAME                                                                           MOBILE                                                        HOME
<<CONTACTS_FIRSTNAME>>                        <<CONTACT_MOBILEPHONE>>             <<CONTACT_HOMEPHONE>>
  • September 12, 2008
  • Like
  • 0