6 Replies Latest reply: Apr 27, 2017 8:40 PM by John Cavoulas RSS

    Salesforce Connector 13.x and 14.x error when fetching CaseHistory table

    Stewart Mac

      Hi,

       

      I get an error when fetching data from CaseHistory table from Salesforce.  I test both Salesforce Connector 13.x and 14.x.  The error and SQL is below.

       

      Unable to get column information for the fields that are used in the query. Please make sure you have only one SELECT statement in a query editor. Description: Relationship queries with polymorphic key (keywords TYPEOF, Owner, Who and What) are not supported by the connector.

      SQL SELECT

      Id,

      CaseId,

      NewValue,

      OldValue,

      IsDeleted,

      CreatedDate,

      Field

      FROM CaseHistory

      where CreatedDate >= 2009-01-01T00:00:00.000Z and CreatedDate <= 2009-02-01T00:00:00.000Z  and Field ='Owner';


      Any idea on how to resolve the error?

        • Re: Salesforce Connector 13.x and 14.x error when fetching CaseHistory table
          John Cavoulas

          I use version 11 connector and don't have any issues using your SOQL. I set the API to 38. You may also want to try it without the SQL designation a la;

           

          SELECT

          Id,

          CaseId,

          NewValue,

          OldValue,

          IsDeleted,

          CreatedDate,

          Field

          FROM CaseHistory

          where CreatedDate >= 2009-01-01T00:00:00.000Z and CreatedDate <= 2009-02-01T00:00:00.000Z

          and Field ='Owner';

           

          I haven't much success using the newer connectors.

            • Re: Salesforce Connector 13.x and 14.x error when fetching CaseHistory table
              Stewart Mac

              Hi John,

               

              Version 11 connector is working fine.  However, we need to migrate to the new connector 13 or 14 because our Salesforce environment is deprecating TLS 1.0.  Version 13 and 14 support Salesforce TLS 1.1 and 1.2. 

               

              Have you use version 13 or 14 and the sql works for you?

               

              Thanks,

              Stewart

                • Re: Salesforce Connector 13.x and 14.x error when fetching CaseHistory table
                  John Cavoulas

                  Hi Stewart,

                   

                  I tried version 12 a couple years ago and it was just too inconsistent. I will have to try v13 or v14 and see how it goes. The problem (for now) is switching back and forth between versions...uninstall/install...a pain. I will look into whether or not our environment will be affected, but fortunately I have another computer I can try this on but we're in the middle of upgrading to QlikView version 12.

                   

                  V/r,

                  John

                  • Re: Salesforce Connector 13.x and 14.x error when fetching CaseHistory table
                    John Cavoulas

                    So, I was able to use connector version 13.1 and get the query to run in both Bulk and SOAP connectors, but I had to utilize a preceding load for the Field = 'Owner' clause. Is this acceptable to you? I don't use SOAP version but included it just the same. I also changed the date ranges for my data.

                     

                    Using Bulk...

                     

                    BULK:

                    Load *

                         Where Field = 'Owner';

                    Select

                    Id,

                    CaseId,

                    NewValue,

                    OldValue,

                    IsDeleted,

                    CreatedDate,

                    Field

                    FROM CaseHistory

                    where CreatedDate >= 2017-04-01T00:00:00.000Z

                    And CreatedDate <= 2017-04-26T00:00:00.000Z;

                     

                    And using SOAP...

                     

                    SOAP:

                    Load *

                         Where CaseHistory.Field = 'Owner';

                    Select

                    Id,

                    CaseId,

                    NewValue,

                    OldValue,

                    IsDeleted,

                    CreatedDate,

                    Field

                    FROM CaseHistory

                    where CreatedDate >= 2017-04-01T00:00:00.000Z

                    And CreatedDate <= 2017-04-26T00:00:00.000Z;

                     

                    HTH,

                    John