• jgoldsack
  • NEWBIE
  • 0 Points
  • Member since 2005

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
I am building custom Modules for a DotNetNuke portal I am working on, and one of the modules I am working on is using the Web-To-Case servlet. Out current version uses classic ASP to post a form to the servlet using standard form post. Because of the nature of DNN, this cannot be done using a simple form post (since cannot have 2 forms on the same page), so I am using the WebClient class, encoding the form variables in UTF-8, and then posting the values to the servlet. This all executes fine, no errors, and I get a response back from the Servlet stating there were no errors.... but the case never shows up in SalesForce, and I have not found any way to tell if it actually works.

Sample of my code:

Dim formPostData As String = ""
For Each postKey As String In Request.Form
Dim postValue As String = Request.Form(postKey)
formPostData = (formPostData + String.Format("&{0}={1}", postKey, postValue))
Next

Dim client As WebClient = New WebClient
client.Headers.Add("Content-Type", "text/html;charset=UTF-8")
Dim postByteArray() As Byte = Encoding.UTF8.GetBytes(formPostData)
Dim responseArray() As Byte = client.UploadData("http://www.salesforce.com/servlet/servlet.WebToCase?encoding=UTF-8", "POST", postByteArray)
Dim response As String = Encoding.ASCII.GetString(responseArray)

Select Case (response)
'Do something with the response
End Select


Is there something I am missing? The form fields that I pass are the same as are in the ASP version, so I am unsure what is going on, or how to tell if there actually is an error.

I have a VB.NET application, with version 6 of the API, that pulls data from certain SalesForce tables, and puts that data in some local SQL tables for analysis. I am having an error when I try to retrieve custom fields.

INVALID_FIELD:

select Id, AccountNumber, Active__c, AnnualRevenue, BillingCity
^
ERROR at Row:1:Column:27

No such column 'Active__c' on entity 'Account'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names."

I am building the query string thusly:

_sQuery = New StringBuilder
_sQuery.Append("select ")
_sQuery.Append("Id, ")
_sQuery.Append("AccountNumber, ")
_sQuery.Append("Active__c, ")
_sQuery.Append("AnnualRevenue, ")
_sQuery.Append("BillingCity, ")
...
 _sQuery.Append("from Account ")
_sQuery.Append("where LastModifiedDate > " & LastUpdate)
qr = binding.query(_sQuery.ToString)

When I run the query, the error occurs. It appears to happen to any custom field in any table I try and query. The custom field is in the WSDL, and is generated correctly in the .vb files for the wsdl. I am not sure what is going on here (could it be a permissions issue on the SalesForce user?), and would appreciate any help in this matter.

Message Edited by jgoldsack on 09-29-2005 08:42 AM

I am building custom Modules for a DotNetNuke portal I am working on, and one of the modules I am working on is using the Web-To-Case servlet. Out current version uses classic ASP to post a form to the servlet using standard form post. Because of the nature of DNN, this cannot be done using a simple form post (since cannot have 2 forms on the same page), so I am using the WebClient class, encoding the form variables in UTF-8, and then posting the values to the servlet. This all executes fine, no errors, and I get a response back from the Servlet stating there were no errors.... but the case never shows up in SalesForce, and I have not found any way to tell if it actually works.

Sample of my code:

Dim formPostData As String = ""
For Each postKey As String In Request.Form
Dim postValue As String = Request.Form(postKey)
formPostData = (formPostData + String.Format("&{0}={1}", postKey, postValue))
Next

Dim client As WebClient = New WebClient
client.Headers.Add("Content-Type", "text/html;charset=UTF-8")
Dim postByteArray() As Byte = Encoding.UTF8.GetBytes(formPostData)
Dim responseArray() As Byte = client.UploadData("http://www.salesforce.com/servlet/servlet.WebToCase?encoding=UTF-8", "POST", postByteArray)
Dim response As String = Encoding.ASCII.GetString(responseArray)

Select Case (response)
'Do something with the response
End Select


Is there something I am missing? The form fields that I pass are the same as are in the ASP version, so I am unsure what is going on, or how to tell if there actually is an error.

I have a VB.NET application, with version 6 of the API, that pulls data from certain SalesForce tables, and puts that data in some local SQL tables for analysis. I am having an error when I try to retrieve custom fields.

INVALID_FIELD:

select Id, AccountNumber, Active__c, AnnualRevenue, BillingCity
^
ERROR at Row:1:Column:27

No such column 'Active__c' on entity 'Account'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names."

I am building the query string thusly:

_sQuery = New StringBuilder
_sQuery.Append("select ")
_sQuery.Append("Id, ")
_sQuery.Append("AccountNumber, ")
_sQuery.Append("Active__c, ")
_sQuery.Append("AnnualRevenue, ")
_sQuery.Append("BillingCity, ")
...
 _sQuery.Append("from Account ")
_sQuery.Append("where LastModifiedDate > " & LastUpdate)
qr = binding.query(_sQuery.ToString)

When I run the query, the error occurs. It appears to happen to any custom field in any table I try and query. The custom field is in the WSDL, and is generated correctly in the .vb files for the wsdl. I am not sure what is going on here (could it be a permissions issue on the SalesForce user?), and would appreciate any help in this matter.

Message Edited by jgoldsack on 09-29-2005 08:42 AM