This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - Listing Files

PlasmaTek - Friday, June 22, 2012 3:29 AM:

Hi All

I'm a Aras Noob, so go easy on me please ;0)

My aim is to get a file listing of certain file types in order to get to their url's, ideally I would like to get access to their UNC path (is this possible). My problem is querying for multiple file types. The example below always gives me the last file type, but not all of them. I'm obviously missing the correct way to set multiple properties.

String par = "CC217ECFAF0E45BB80D1CE570DD54877";
String dft = "A6F4974401834C56880B6A732D33A0AF";
String asm = "B1F21B3CCF4F44B6960B8A38AECE4E69";

Aras.IOM.Item qryItem = MyInnovator.newItem("File", "get");
qryItem.setAttribute("select", "id,keyed_name,modified_on,item_number,filename,file_type");

qryItem.setProperty("file_type", par);
qryItem.setProperty("file_type", dft);
qryItem.setProperty("file_type", asm);
qryItem.setPropertyCondition("file_type", "eq");

Aras.IOM.Item results = qryItem.apply();

 



Boro - Monday, June 25, 2012 7:50 PM:

Hi,

You can use property attribute condition="in", and set the property value as comma delimited like following code.

----

String par = "CC217ECFAF0E45BB80D1CE570DD54877";

String dft = "A6F4974401834C56880B6A732D33A0AF";

String asm = "B1F21B3CCF4F44B6960B8A38AECE4E69";

String filetypeIds = prt + "," + dft + "," + asm;

Aras.IOM.Item qryItem = MyInnovator.newItem("File", "get");

qryItem.setAttribute("select", "id,keyed_name,modified_on,item_number,filename,file_type");

qryItem.setProperty("file_type", filetypeIds);

qryItem.setPropertyCondition("file_type", "in");

'  Or you can use setPropertyAttribute method

'  qryItem.setPropertyAttribute("file_type","condition","in");

Aras.IOM.Item results = qryItem.apply();

----

Hope this help.Thanks.