Forum Discussion
Hi,
The "where" string in plain AML queries requires 3 different types of quotation marks.
Something like this depending on your programming language.
"<AML><Item type='Document' action='get' where='[Document].item_number=\"MADL002828\"' select='id'/></AML>"
Tip: In Methods I would try to avoid this AML query style if possible. Sometimes you have to use it, but for simple queries a format like this is easier to write an read::
Item updateItem = inn.newItem("Document");
updateItem.setAction("get");
updateItem.setAttribute("where","[Document].id =' " + myvariable + " ' ");
updateItem.setAttribute("select","id");
updateItem = updateItem.apply();
In general also avoid to use the "where" statement if you don´t need it. If you know the item_number or id of something, you don´t need to use "where" at all:
Item updateItem = inn.newItem("Document");
updateItem.setAction("get");
updateItem.setProperty("item_number","12345");
OR ( updateItem.setID("123....."); )
updateItem.setAttribute("select","id");
updateItem = updateItem.apply();
Best regards!
Angela