SDK : ERROR 60029,Attribute “2,021” not found.
Hi Everyone,
Need your advice, i have query item, to display value from PageTwo.list02.
Current condition: PageTwo.list02 –> visible = No.
When running the query, i got an error message :
ERROR 60029,Attribute “2,021” not found.
But if PageTwo.list02 –> visible = Yes.
Then code will be successful without any error.
Please advise, on how to handle/get the value of this field when visible = No. Thank you.
===============================================
public class ItemQuery {
public static IAgileSession session = null;
public static AgileSessionFactory factory;
public static IQuery query;
public static IAttribute[] attrs;
public static void main(String[] args) {
try {
// Create an IAgileSession instance.
session = connect(session);
query = (IQuery)session.createObject(IQuery.OBJECT_TYPE,
ItemConstants.CLASS_ITEM_BASE_CLASS);
query.setCaseSensitive(false);
query.setCriteria(“[Title Block.Number] contains ‘233413-001′”);
// Execute query and print results.
printQueryResult();
} catch (APIException e){
System.out.println(e.getErrorCode() + “,” + e.getMessage());
System.out.println(e.getRootCause());
} catch (Exception e) {
e.printStackTrace();
} finally {
session.close();
}
}
private static void printQueryResult() throws APIException, ParseException {
Iterator i = query.execute().iterator();
// If there are no matching items, display an error message.
if (!i.hasNext()) {
System.out.println(“No Matching Items”);
return;
}
while (i.hasNext()) {
IRow row = (IRow)i.next();
IItem itemObj = (IItem)row.getReferent();
String type = (String) itemObj.getValue(ItemConstants.ATT_PAGE_TWO_LIST02);
System.out.println(type);
}
}
private static IAgileSession connect(IAgileSession session)
throws APIException {
HashMap params = new HashMap();
params.put(AgileSessionFactory.USERNAME, USERNAME);
params.put(AgileSessionFactory.PASSWORD, PASSWORD);
factory = AgileSessionFactory.getInstance(URL);
session = factory.createSession(params);
return session;
}
}
regards,
lingga