• trevor_miles
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
I am trying to create an ASP.NET app that allows the user to define the fields that they want returned from a SOQL query, and to embed the result in a Recordset for display or persistence purposes.  Creating valid SOQL and executing the query is done and tested.
 
What I have difficulty with is extracting the information from the query result since I do not know in advance the primary SFDC object used in the SOQL query, nor do I know the fields selected.  I have no problems doing this with a static SOQL statement, meaning I know the primary object and the fields, especially as I want to make this generic to any organization.  An example of my VB.NET code for a known SOQL statement is below.
 
Code:
        ' Traverse the SOQL statement to create the columns and headers
        ' This could be improved to include made the columns the same type as the SFDC fields
        ds.Tables.Add()
        With ds.Tables(0)
            i = InStr(sq, " ") + 1
            j = InStr(i, sq, " ")
            field = Mid(sq, i, j - i - 1)
            Do Until field.ToLower = "from"
                .Columns.Add(field)
                i = j + 1
                j = InStr(i, sq, " ")
                field = Mid(sq, i, j - i)
                If InStr(field, ",") > 0 Then field = Left(field, Len(field) - 1)
            Loop

            For i = 0 To qr.records.GetUpperBound(0)
                '  This only works if the primarySFDC object in the SOQL query is an Opportunity
                Dim opportunity As sforce.Opportunity = CType(qr.records(i), Opportunity)
                Dim row As System.Data.DataRow
                row = .Rows.Add
                ' This only works if I know the fields in advance
                With row
                    row(0) = opportunity.Account.Name
                    row(1) = opportunity.Name
                    row(2) = opportunity.Owner.Name
                    row(3) = opportunity.Description
                    row(4) = opportunity.StageName
                    row(5) = Format(opportunity.CloseDate, "yyyy/MM/dd")
                    row(6) = opportunity.FiscalQuarter
                    row(7) = opportunity.Amount.ToString
                End With
            Next
        End With

 
I am trying to create an ASP.NET app that allows the user to define the fields that they want returned from a SOQL query, and to embed the result in a Recordset for display or persistence purposes.  Creating valid SOQL and executing the query is done and tested.
 
What I have difficulty with is extracting the information from the query result since I do not know in advance the primary SFDC object used in the SOQL query, nor do I know the fields selected.  I have no problems doing this with a static SOQL statement, meaning I know the primary object and the fields, especially as I want to make this generic to any organization.  An example of my VB.NET code for a known SOQL statement is below.
 
Code:
        ' Traverse the SOQL statement to create the columns and headers
        ' This could be improved to include made the columns the same type as the SFDC fields
        ds.Tables.Add()
        With ds.Tables(0)
            i = InStr(sq, " ") + 1
            j = InStr(i, sq, " ")
            field = Mid(sq, i, j - i - 1)
            Do Until field.ToLower = "from"
                .Columns.Add(field)
                i = j + 1
                j = InStr(i, sq, " ")
                field = Mid(sq, i, j - i)
                If InStr(field, ",") > 0 Then field = Left(field, Len(field) - 1)
            Loop

            For i = 0 To qr.records.GetUpperBound(0)
                '  This only works if the primarySFDC object in the SOQL query is an Opportunity
                Dim opportunity As sforce.Opportunity = CType(qr.records(i), Opportunity)
                Dim row As System.Data.DataRow
                row = .Rows.Add
                ' This only works if I know the fields in advance
                With row
                    row(0) = opportunity.Account.Name
                    row(1) = opportunity.Name
                    row(2) = opportunity.Owner.Name
                    row(3) = opportunity.Description
                    row(4) = opportunity.StageName
                    row(5) = Format(opportunity.CloseDate, "yyyy/MM/dd")
                    row(6) = opportunity.FiscalQuarter
                    row(7) = opportunity.Amount.ToString
                End With
            Next
        End With

 
Hi There,
 
I am developing SSIS package and connecting to salesforce. I will be using VB Script. I have enterprise dll file as reference in VS. My problem is that I cannot reference login function.
 
here it is

Imports System

Imports System.Data

Imports System.Math

Imports Microsoft.SqlServer.Dts.Runtime

Imports SalesForceService

Public Sub Main()

Dim binding As New SalesForceService. ( here I cannot find SalesForceService.logIn)

There are others such as loginFault,loginResult except Login.

I looked at tutorials but in vain. Please advise me.

Your help is appreciated.