How to search an item object in a PX whose name contains speacial characters

I am facing an issue while searching a Document item using session.getObject.
The session.getObject is not returning any object that has special characters like apostrophe in the number

Add Comment
2 Answer(s)

Which Agile version are you using?
with 9.3.2 the following code returns IItem 123’456 properly

session.getObject(IItem.OBJECT_TYPE, "123'456")

However, try to get the objects using an IQuery

IQuery q = (IQuery) session.createObject(IQuery.OBJECT_TYPE, "Document");
 q.setCriteria("[Number] == %1",new Object[]{"123''456"});

using the double apostrohpe will looking for number 123’456

Agile Angel Answered on December 29, 2015.
Add Comment

I think Single quotes are escaped by doubling them up.
try this query
q.setCriteria(
"[Number] == %1",new Object[]{"123''456"});

Agile Angel Answered on January 24, 2016.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.