• SF ADMINISTRATOR
  • NEWBIE
  • 0 Points
  • Member since 2014

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

 Greetings Folks

I am new to this and have been thrown in to this project.  I am wondering if you can tell me why the following query returns garbled
strings as opposed to logical values.

For example, this should a Bin Location field (gii__BinLocation__c) from a custom table (gii__ProductInventory__c).  And it does, in fact,
do that.  But the field returned should be something like "F-5".  Instead, it looks like "a0Mi0000002lir9EAA".

Got any ideas?


        Dim results As JacoApex.QueryResult = Nothing
        results = bindingService.query("select gii__BinLocation__c from gii__ProductInventory__c WHERE Product_Name__c = '" & productid & "' ")


        If results.records Is Nothing Then
            Return ""
        Else
            Dim record As JacoApex.sObject = results.records(0)
            Dim sfval As String = getFieldValue(gii__BinLocation__c", record.Any)
            Return sfval
        End If

Greetings

I am trying to update a Custom Object with te SalesForce API but I keep getting an error that the ID I am sending to the custom object is not a valid SalesForce ID.

This is happening on a custom object for our Contacts.

I don't really know the best way to explain it but here it goes.

We have a custom object on our Accounts named "Account Refernece".  The Account Refernece Object is created (by default) once we add an account.  But then I need to update the Account Refernece with more information.  Thus:

Step 1: Create Account and return the salesforce account id
Step 2: Update the account reference object with the salesforce account id in step 1

When trying to do step 2 I am presented with this error:

 '001i000000wxerh' is not a valid Salesforce ID for the type Account Reference

And for some reason "001i000000wxerh" is actually truncated to 15 characters.  The actual id retuned in step 1 is 18 characters "001i000000wxerhAAA".  But from what I have read that does not matter.  It is the first 15 characters that count.

Here is a snippet of the fields where myFields(0) is the account id returned in step 1.  Does anyone know what I am doing wrong?

        Dim AccountObject As sObject = New JacoApex.sObject()
        Dim myFields As System.Xml.XmlElement() = New System.Xml.XmlElement(5) {}

        Dim doc As New System.Xml.XmlDocument()

        myFields(0) = doc.CreateElement("id")
        myFields(0).InnerText = account.ToString

        myFields(1) = doc.CreateElement("Credit_Card_No__c")
        myFields(1).InnerText = cardnumber

        myFields(2) = doc.CreateElement("Credit_Card_Exp_Date__c")
        myFields(2).InnerText = cardexpires

        myFields(3) = doc.CreateElement("CVV2_Code__c")
        myFields(3).InnerText = cvvcode

        myFields(4) = doc.CreateElement("Name_On_Card__c")
        myFields(4).InnerText = nameoncard

        myAccountRef.type = "gii__AccountAdd__c"
        myAccountRef.Any = myFields

        Dim myAccountRefList As sObject() = New sObject(0) {}
        myAccountRefList(0) = AccountObject

        Dim results As SaveResult() = bindingService.update(myAccountRefList)

 Greetings Folks

I am new to this and have been thrown in to this project.  I am wondering if you can tell me why the following query returns garbled
strings as opposed to logical values.

For example, this should a Bin Location field (gii__BinLocation__c) from a custom table (gii__ProductInventory__c).  And it does, in fact,
do that.  But the field returned should be something like "F-5".  Instead, it looks like "a0Mi0000002lir9EAA".

Got any ideas?


        Dim results As JacoApex.QueryResult = Nothing
        results = bindingService.query("select gii__BinLocation__c from gii__ProductInventory__c WHERE Product_Name__c = '" & productid & "' ")


        If results.records Is Nothing Then
            Return ""
        Else
            Dim record As JacoApex.sObject = results.records(0)
            Dim sfval As String = getFieldValue(gii__BinLocation__c", record.Any)
            Return sfval
        End If