25
Views
11
Comments
ListClear action in Service Studio?
Question
Dear All,

It's very easy to fill an array (Record List variable type) in Outsystems.

I'm currently trying to clear an array in a generic way.
I.e. by calling a (currently non-existing) ListClear action.

Offcourse It's possible to create another variable with the same but empty structure,
but it would be very nice to have this in a function.

Regards,

Eric 

2020-03-05 15-52-45
André Vieira
Staff

Hi Eric,

You can use the attached extension to do what you want. You have to call the method in Service Studio passing the RecordList variable enclosed in a ToObject() call.

Cheers,
André
RecordListUtils.xif
2018-09-07 11-54-27
Eric Oud Ammerveld
Hi André,

Thanks for your quick response.
I'm getting compile error:

NET Compilation.
 
GetFrameworkPaths:
 Could not locate the .NET Framework SDK.  The task is looking for the path to the .NET Framework SDK at the location specified in the SDKInstallRootv2.0 value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework.  You may be able to solve the problem by doing one of the following:  1.) Install the .NET Framework SDK.  2.) Manually set the above registry key to the correct location.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning MSB3245: Could not resolve this reference. Could not locate the assembly "nunit.framework, Version=2.5.3.9345, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
RecordListUtilsTest.cs(4,7): error CS0246: The type or namespace name 'NUnit' could not be found (are you missing a using directive or an assembly reference?)
RecordListUtilsTest.cs(13,10): error CS0118: 'OutSystems.NssRecordListUtils.RecordListUtilsTest.SetUp()' is a 'method' but is used like a 'type'
RecordListUtilsTest.cs(27,10): error CS0246: The type or namespace name 'Test' could not be found (are you missing a using directive or an assembly reference?)
2020-03-05 15-52-45
André Vieira
Staff
Hi Eric,

Forgot to include a dll in the extension.

See if this one's ok.

Cheers,
André
RecordListUtils.xif
2018-09-07 11-54-27
Eric Oud Ammerveld
Hi André,

After I've changed the IPP on the XIF. (https://www.outsystems.com/ipp/)
I was able to publish the extension.

This works like a charm; thanks and thumbs up!

Any chance of a JAVA version being created for this or an adoption in the platform under Built-in Actions as ListClear ? :)
2020-03-05 15-52-45
André Vieira
Staff

Hi Eric,

Glad I could help.

Attached is full version both for .NET and Java.

Cheers,
André
RecordListUtils.xif
2018-09-07 11-54-27
Eric Oud Ammerveld
Thanks André!
2018-09-07 11-54-27
Eric Oud Ammerveld
Hi Guy's,

Is there any chance that the ListClear() function is adopted as part of the Built-in functions?

A ListInvert() and ListSort() would be nice too by the way. ;)
2017-10-02 14-22-21
Paulo Tavares
Staff
Hi Eric,

Well, I'm taking a chance here and say that there is indeed a good chance that the ListClear action will be part of Service Studio's built-in functions in the future.

I won't say the same for the ListInvert and ListSort, though, but you can always propose that in our Wisdom of the Crowds ;)

Regards,

Paulo Tavares
2018-09-07 11-54-27
Eric Oud Ammerveld
Thanks!

I will post the idea there!
2013-05-16 15-48-18
ovatsus
Check also the ListUtils component.

Best Regards,
Gustavo Guerra
2018-09-07 11-54-27
Eric Oud Ammerveld
Thanks Gustavo, that indeed provides a part of what I need. 
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.