Originally asked by Andrea Mura on 24 April 2024 (original question)
Hi All,
This problem cropped up immediately after exalate salesforce updated to 5.11.
in an incoming script, on a specific connection, we have this piece of code that makes a query using the salesforce rest api to find from the name (which comes from Jira) the d to be able to fill in a lookup field.
code:
if (replica.customKeys.“Functional area” != null) {
String FA = replica.customKeys.“Functional area”
def resFA = httpClient.get(“/services/data/v54.0/query/?q=SELECT+Id+FROM+Functional_Area__c+WHERE+Name=%27${FA}%27”)
entity.FunctionalArea__c = resFA.records.Id[0]
}
before the update it worked correctly, but now it has this error:
Illegal character in query at index 125: https://mycomp-uat.sandbox.my.salesforce.com/services/data/v54.0/query/?q=SELECT+Id+FROM+Functional_Area__c+WHERE+Name='Cloud Operations’
I think it’s a character enoding management problem, but I don’t know what changed with the latest version and I can’t get it to work.
What has changed? How can we adapt the code to the new version?
Thanks,
Andrea
Comments:
Stéphane Thillay commented on 24 April 2024
Hi,
In similar context (v5.11, querying on Salesforce, submit an Id to get a Name) I get a different error since yesterday:
Bad response when GET to /services/data/v54.0/query/?q=SELECT+Name+FROM+User+WHERE+Id=%270051i000003DfTuAAK%27 - 400 [{"message":"A query string has to be specified","errorCode":"MALFORMED_QUERY"}]
I opened a ticket.
Regards,
Stéphane
Andrea Mura commented on 25 April 2024
Hi Stéphane,
I have the same problem as you if I modify the code pointing to a static query. I also opened a ticket and am waiting for a response, let’s update if we find a solution.
Regards,
Andrea