Uploaded image for project: 'CloverDX'
  1. CloverDX
  2. CLO-9903

SalesforceReader doesn't return subquery results when letter case in query doesn't match

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: rel-4-4-0
    • Component/s: Engine
    • Security Level: Users (General product issues)
    • Labels:
    • Branch:
    • QA Testing:
      Graph automated test
    • QA Test Identification:
      SalesforceReader_relation_parentToChild_CLO-9903
    • Sprint:
      PRG Sprint 28, PRG Sprint 29

      Description

      SalesforceReader is case sensitive when it shouldn't. This query works as expected:

      SELECT (SELECT Name FROM Opportunities), Name, Owner.UserType FROM Account WHERE jobIdent__c = '${JOB_IDENT}'
      

      But when you change letter case in subquery (Opportunities -> opportunities), the reader returns 0 records. It's caused by the component expecting the subquery results in the xml element with exactly the same letter case as in the query.

      Actual result looks like this no matter what letter case you use in the query:

      <result xsi:type="QueryResult">
      	<done>true</done>
      	<queryLocator xsi:nil="true" />
      	<records xsi:type="sf:sObject">
      		<sf:type>Account</sf:type>
      		<sf:Id xsi:nil="true" />
      		<sf:Opportunities xsi:type="QueryResult">
      			<done>true</done>
      			<queryLocator xsi:nil="true" />
      			<records xsi:type="sf:sObject">
      				<sf:type>Opportunity</sf:type>
      				<sf:Id xsi:nil="true" />
      				<sf:Name>oppForAccount1</sf:Name>
      			</records>
      			<records xsi:type="sf:sObject">
      				<sf:type>Opportunity</sf:type>
      				<sf:Id xsi:nil="true" />
      				<sf:Name>oppForAccount2</sf:Name>
      			</records>
      			<records xsi:type="sf:sObject">
      				<sf:type>Opportunity</sf:type>
      				<sf:Id xsi:nil="true" />
      				<sf:Name>oppForAccount3</sf:Name>
      			</records>
      			<size>3</size>
      		</sf:Opportunities>
      		<sf:Name>account_with_opportunities</sf:Name>
      		<sf:Owner xsi:type="sf:sObject">
      			<sf:type>User</sf:type>
      			<sf:Id xsi:nil="true" />
      			<sf:UserType>Standard</sf:UserType>
      		</sf:Owner>
      	</records>
      	<size>1</size>
      </result>
      

      Notice that the subquery results come in Opportunities element which is the API Name of the salesforce object.

      The component should look for elements named by API names of the relevant objects.

        Attachments

          Activity

            People

            • Assignee:
              salamonp Pavel Salamon
              Reporter:
              salamonp Pavel Salamon
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: