Hello Everybody,

I am trying to use the following command in a .dll file in .NET as an extension to Outsystems to list all of the files in their directories:

String[] myNames = Directory.GetFiles(myDir, "*.*", SearchOption.AllDirectories);

The input, MyDir, will be a string of the extension. The output, 'myNames' will be an array of strings of the extension.  The first problem is when I attach this file as an extension to Outsystems, Outsystems converts my input to an object, which I don't want it to do.  The second problem is that Outsystems will make my output a string, but not an array of strings.  The third problem is the Foreach loop in Outsystems will only take a record.  I need the Foreach loop to loop through an array of strings.

Is Outsytems limited in what it could do in this area?  Do I need to do all of this work in .NET and then attached it to Outsystems as an extension. 

Attached is the output of a .dll file that I displayed in a gridview in .NET.
Frank -

Your best bet is to NOT directly import the DLL as an extension. That often does not do so well because of the way Agile Platform likes to interface with extensions.

Instead, create an Extension with actions using an output definition of Record List, and the record definition should have a structure with just a Text object in it. Then edit the extension's code. In the code, do a reference to your DLL, and make sure to set "Copy Local = True". Call your function as needed, then loop through the resulting array, popping the results into the appropriate OutSystems objects and adding them to the Record List. That can be a little tricky. If you get held up with that part of up, send me a private message and I'll gladly spend a few minutes on a screen share with you to show you what the code looks like, once you get it, you get it, but the first time dealing with the Record Lists in the .NET code can be a touch tricky.