Record List Search

Record List Search

  
Hello, again :-)

Is there a way of searching a value inside a Record List. The only way I can think of, is by looking all over the rows, using a For Each. But that doesn't look very efficient... How can I do that?

Best regards,

Hugo Laibaças
Direcção-Geral do Orçamento
Hi Hugo,

Well, depending on what you're trying to achieve, the way I would do it would be to re-do the query, using the search parameter you have in mind, and replace the Record List.

Other than that, doing the for each loop is indeed the only - and not very efficient way :) - of doing it.

Would the first alternative do the trick for you? What are you trying to achieve?

Regards,

Paulo Tavares
I see.

I'm invoking a web service method that returns a pair <Code, Desgination> record list.
I want that everytime someone types a correct Code, show the Designation near the Code, so the user can see if that is what he wants. I'm trying to do this by using the OnChange event of the Code text box. This way, everytime the Code text box changes, I want to look for the correspondent Designation, but first, I must confirm that the Code is a valid one.
Did you get the picture?

As far as I understand, the only way of doing this is using the For Each loop, right?

Best Regards,

Hugo Laibaças
Direcção-Geral do Orçamento
Hi Hugo,

Well, if you don't have direct access to the database, the way I see it is executing the for-each loop, yes.

Is this feasible to you?

Regards,

Paulo Tavares
Hi Paulo.

Yes, it is feasible.
The thing is that sometimes the record lists may be very long... It would be nice if the agile platform had a structure (similar to record list) with a field that could be used as Key to reach a Value. This way, the complexity would be O(1) and not O(n).

Anyway, thank you very much for your support.

Regards,

Hugo Laibaças
Direcção-Geral do Orçamento
Hi Hugo,

If you consider this implementation really useful... post your idea using the Wisdom Of The Crowds http://www.outsystems.com/wisdomofthecrowds/ 
It will be shared with all community members for improvements, votes and discussion.

Regards,
Rafael Pereira