• DotNetDevil
  • NEWBIE
  • 0 Points
  • Member since 2003

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

Hi,

  I'm trying to retrieve "Standard User" from the Name field of the Profile object with the following query: "select Id, Name from Profile where Name = Standard User"  but that always complains about a malformed query. 

  So I tried "select Id, Name from Profile" and then cast the result into Profile objects, and then scan for a Profile with Name equal to "Standard User".   However, the contents of the Profile names are unexpecting:

PT1
Custom: Marketing Profile
Custom: Sales Profile
Custom: Support Profile 
PT2
PT3
PT4
PT5
PT6

  The Profile names represented by the PT# different for different logins, and so I cannot consistently select Standard User.  Any clues, hints?

Thanks,

Tan

Hi,

Im trying to develope an application in .NET environment with SForce API. While trying to run the code downloaded from sForce.com in VB.NET the following error is shown

The server returned the following fault information:

Fault Code: 0

Fault string: invalid date format: 0001-01-01T00:00:00.0000000+0530

The program '[1636] QueryFilter.exe' has exited with code 0 (0x0).

The Function where the error is reported is reproduced for your reference: (class clsSForce.vb in QueryFilter_2003 Sample Code for VB.NET)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Friend Function SampleQueryFilter_Simple(ByVal SelectList() As String) As Boolean

Dim ret() As Object

Dim filter(0) As Object 'Final filter array

'Create simple filter

filter(0) = MakeSimpleFilter("ownerID", MyID, "equals")

Try

ret = sForce.query("filter", "contact", 20, SelectList, filter, Nothing, Nothing, False)

Catch ex As System.Web.Services.Protocols.SoapHeaderException

'This is typical error handling for fault detection and reporting, the .Net Proxy client actually throws an

'error rather than return the fault SOAP Message.

Trace.WriteLine("The server returned the following fault information:")

Trace.WriteLine("Fault Code: " & CType(CType(ex, System.Web.Services.Protocols.SoapException).Code, System.Xml.XmlQualifiedName).Name())

Trace.WriteLine("Fault string: " & ex.Message)

Return False

End Try

Try

Dim i As Integer = 1

Dim j As Integer

Dim rootNode As System.Xml.XmlElement = ret(0)

If rootNode.InnerText.Length > 0 Then

Dim children As System.Xml.XmlNodeList = rootNode.SelectNodes("valueMap")

Dim valueNode As System.Xml.XmlNode

For Each valueNode In children

Console.WriteLine("record " & i)

For j = SelectList.GetLowerBound(0) To SelectList.GetUpperBound(0)

Console.Write(vbTab & SelectList(j) & ": ")

Dim textNode As Xml.XmlNode = valueNode.SelectSingleNode(SelectList(j))

If Not textNode Is Nothing Then

Console.Write(valueNode.SelectSingleNode(SelectList(j)).InnerText)

Else

Console.Write("")

End If

Console.WriteLine(", ")

Next

Console.WriteLine(" ")

i += 1

Next

Return True

Else

Return False

End If

Catch ex As System.Exception

System.Diagnostics.Trace.WriteLine("Unexpected error: " & ex.Message)

Return False

End Try

End Function

++++++++++++++++++++++++++++++++++++++++++++++++++++

Please help
Vineet Gogia