Forum Discussion

angela's avatar
angela
Catalyst II
8 years ago

Is it possible to use the checkout function for multible files?

Hi, is it possible to use the checkout function for multible files at once?
Item file = this.newItem("File","get");
file.setAttribute("idlist", idlist); // <- contains multible file id´s, checkout do not work
// file.setID(id); // <- contains one file id, checkout works
file=file.apply();
file.checkout("C:\\temp\\test");	
The above example works fine for a single file. My idea was, to use the idlist attribute for checkout multible files. But the checkout Method doesn´t accept this (no single item). Is there another solution for this case? I want to avoid using a FOR loop for file checkout to keep the server load low. Best regards! Angela

2 Replies

  • Hi Angela, While it's not possible to use the checkout function with multiple files, the IOM.dll does define a CheckoutManager object specifically for this functionality. Please see the updated code below for an example of how to use the CheckoutManager.
    Item files = this.newItem("File", "get");
    files.setAttribute("idlist", idlist);
    files = files.apply();
    IomFactory iom = new IomFactory();
    Aras.IOME.CheckoutManager cm = iom.CreateCheckoutManager(files);
    cm.DownloadFiles(@"C:\Temp\test", 1);
    You can find more details about the CheckoutManager in the .NET API Reference within Innovator. Chris _______________________________________ Christopher Gillis Aras Labs Software Engineer
  • Hi Chris, I tested your code today and the result is really impressive. My checkout variant increases the server load dramatically. As soon as I used your variant it happend...nothing! The server seems to be quite bored - that´s pretty cool! Many thanks! Angela