Hey everyone, I am getting this error. Any idea on...
# suitetalkapi
a
Hey everyone, I am getting this error. Any idea on what could be the reason? I am doing a contact search and the role already has this permission. ""title":"Invalid search query Search error occurred: Invalid or unsupported search.","status":400,"o:errorCode":"INVALID_PARAMETER"
c
Can you provide the query?
a
The date format on the UI is different from what I have used on the search code. Can that be an issue?
WHERE (contact.datecreated >= '7/10/2020 120000 AM' OR contact.lastmodifieddate >= '7/10/2020 120000 AM' OR company.datecreated >= '7/10/2020 120000 AM' OR company.lastmodifiedDate >= '7/10/2020 120000 AM')
b
that looks like a fragment of sql
and its comparing a timestamp to a string, which is unlikely to work
c
You may need to wrap those in
TO_DATE()
functions like
Copy code
WHERE (contact.datecreated >= TO_DATE( '7/10/2020' ) ...
a
{"q":"SELECT contact.id,contact.firstname,contact.lastname,contact.email,contact.comments,contact.contactsource,contact.datecreated,contact.globalsubscriptionstatus,contact.isinactive,contact.lastmodifieddate,contact.title,contact.custentity_cm_languagepreference,contact.custentity_contact_salutation_form_field,contact.custentity_cm_occupation,contact.custentity_cm_specialty,contact.custentity_cm_classification,contact.custentity_cm_contact_owner,contact.custentity_cm_kol_program,contact.custentity7,contact.custentity_cm_buyinggroup,contact.custentity_postal_code_contact,contact.company.entitytitle as companyaltname,contact.addressbookaddress.addr1 as addr1,contact.addressbookaddress.city as city,contact.addressbookaddress.state as state,contact.addressbookaddress.zip as zip,contact.addressbookaddress.country as country FROM contact , contactaddressbook addressbook, contactaddressbookentityaddress addressbookaddress, entity company WHERE (contact.datecreated >= '7/10/2020 120000 AM' OR contact.lastmodifieddate >= '7/10/2020 120000 AM' OR company.datecreated >= '7/10/2020 120000 AM' OR company.lastmodifiedDate >= '7/10/2020 120000 AM') AND contact.id = addressbook.entity AND addressbook.addressbookaddress = addressbookaddress.nkey AND contact.company = company.id"}
Sorry just the portion got copied earlier. Here is the complete request file that is being sent
c
When I've done date comparisons in the WHERE clause, I've used the TO_DATE() function to cast the string to a Date type. Not sure what you'll need to do to incorporate the time, if that's required. Something with the
fmt
parameter perhaps
a
I am confused because the same code worked in Sandbox, but now that we try in prod, i get that error
c
I would look at differences in the role between environments as well as possible differences in custom records, fields, and lists.
👍 1
a
Thank you. I will compare them now