# The Rookie Rides Again - Datasource question

**URL:** <https://forum.servoy.com/t/the-rookie-rides-again-datasource-question/13498>\
**Category:** Classic Servoy\
**Created:** [January 28, 2011, 3:47am UTC](https://forum.servoy.com/t/the-rookie-rides-again-datasource-question/13498 "2011-01-28T03:47:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RonG](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@RonG](https://forum.servoy.com/u/RonG)\
**Post date:** [January 28, 2011, 3:47am UTC](https://forum.servoy.com/t/the-rookie-rides-again-datasource-question/13498/1 "2011-01-28T03:47:21Z")

</div>

Hi all,

I want to display a form with a particular table record. I can create my own foundset with the correct record in it using something like…  
myfoundset.find();  
myfoundset.serial\_number = some\_global\_variable;  
myfoundset.search();

This will find the correct record for me and put it in the foundset I defined, but I’m not sure how I get that to happen in the datasource specified for the table. For example, I put the above code into the onShow event, and it’s got the record sitting there, but so far I can’t figure out how to tie that to the Datasource.

What incredibly obvious thing am I missing? Any suggestions would be appreciated.

Ron

---

<div class="post-metadata">

**Author:** ![jmeunier](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@jmeunier](https://forum.servoy.com/u/jmeunier)\
**Post date:** [January 28, 2011, 2:29pm UTC](https://forum.servoy.com/t/the-rookie-rides-again-datasource-question/13498/2 "2011-01-28T14:29:08Z")

</div>

On any form, you can work with its underlying foundset just by specifying foundset. So technically…

```auto
forms.myForm.foundset

```

will refer to the form named “myForm” particular foundset.

So your code in an onShow event for the same form would look something like this

```auto
if(foundset.find()){
     foundset.serial_number = globals.some_global_variable;
     foundset.search();
}

```

Hope this helps.

---

<div class="post-metadata">

**Author:** ![RonG](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@RonG](https://forum.servoy.com/u/RonG)\
**Post date:** [January 28, 2011, 4:04pm UTC](https://forum.servoy.com/t/the-rookie-rides-again-datasource-question/13498/3 "2011-01-28T16:04:39Z")

</div>

Thank you, Jason. As always, you are my hero. ![:D]( "Very Happy")

Ron
