# searching via a relation based on a global

**URL:** <https://forum.servoy.com/t/searching-via-a-relation-based-on-a-global/1337>\
**Category:** Classic Servoy\
**Created:** [February 24, 2004, 2:03pm UTC](https://forum.servoy.com/t/searching-via-a-relation-based-on-a-global/1337 "2004-02-24T14:03:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [February 24, 2004, 2:03pm UTC](https://forum.servoy.com/t/searching-via-a-relation-based-on-a-global/1337/1 "2004-02-24T14:03:57Z")

</div>

Hello,

I now have a problem with something that worked before and is described here: [Marking records - Classic Servoy - Servoy Community](http://forum.servoy.com/viewtopic.php?t=347)

The relation is based on the primary key of the dataprovider and a global containing the user\_id. I can enter data through this relation but not find things. It always returns no records.

I have attached a solution that demonstrates the problem. If you look at the table view, there is a popup where you can choose a username. The popup next to that allows you to either see all records or just the “marked” ones. The latter part simply doesn’t work when you do what I am doing in that method.

Thanks  
Patrick

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [February 25, 2004, 6:52pm UTC](https://forum.servoy.com/t/searching-via-a-relation-based-on-a-global/1337/2 "2004-02-25T18:52:21Z")

</div>

The search will be fixed in 2.0RC8

just a remark. in the code you do this:

```auto
controller.loadAllRecords();
controller.find();
data_to_marks.mark = 1;
data_to_marks.username = globals.user_name;
controller.search();

```

but only this is needed

```auto
controller.find();
data_to_marks.mark = 1;
controller.search();

```

(this is not the fix for you, just a tip)

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [February 25, 2004, 9:27pm UTC](https://forum.servoy.com/t/searching-via-a-relation-based-on-a-global/1337/3 "2004-02-25T21:27:04Z")

</div>

Thanks for the tip. That was my first version, but since it didn’t work I tried all kinds of things. Thanks for the fix.
