# global relation issue in startup

**URL:** <https://forum.servoy.com/t/global-relation-issue-in-startup/6785>\
**Category:** Classic Servoy\
**Created:** [November 27, 2006, 5:25am UTC](https://forum.servoy.com/t/global-relation-issue-in-startup/6785 "2006-11-27T05:25:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![faheemhameed](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@faheemhameed](https://forum.servoy.com/u/faheemhameed)\
**Post date:** [November 27, 2006, 5:25am UTC](https://forum.servoy.com/t/global-relation-issue-in-startup/6785/1 "2006-11-27T05:25:44Z")

</div>

I have a global relationship called sysadmin (globals.relation (value = 1) :: relation (value = 1))  
Which is a relation to one record of settings table.

I am using this relation in the startup method of the solution. Strangely some times I get errors like (sysadmin not defined). But It does not happen all the time. I does happen in client and developer.

Please help!

---

<div class="post-metadata">

**Author:** ![rgansevles](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rgansevles](https://forum.servoy.com/u/rgansevles)\
**Post date:** [November 27, 2006, 9:51am UTC](https://forum.servoy.com/t/global-relation-issue-in-startup/6785/2 "2006-11-27T09:51:37Z")

</div>

We are unable to reproduce this, could you please create a support case at: [http://crm.servoy.com/servoy-webclient/ … oy\_support](http://crm.servoy.com/servoy-webclient/solutions/solution/servoy_support)

Please supply a small test solution that shows the problem

---

<div class="post-metadata">

**Author:** ![faheemhameed](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@faheemhameed](https://forum.servoy.com/u/faheemhameed)\
**Post date:** [November 27, 2006, 10:09am UTC](https://forum.servoy.com/t/global-relation-issue-in-startup/6785/3 "2006-11-27T10:09:19Z")

</div>

I cannot reproduce it as well at will.

Next time when it occurs I will make a screen shot of it and send it you.

Thanks for your attention.

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [November 27, 2006, 10:50am UTC](https://forum.servoy.com/t/global-relation-issue-in-startup/6785/4 "2006-11-27T10:50:22Z")

</div>

Hi Hameed,

how are you setting the global?

are you setting the global as a default value?  
are you setting it in startup method?

Because if the global is not there, and you want to do something trough the relation, withou checking the relation, you will get an error.

---

<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:** [November 27, 2006, 11:08am UTC](https://forum.servoy.com/t/global-relation-issue-in-startup/6785/5 "2006-11-27T11:08:42Z")

</div>

This is a long time existing problem that I used to have frequently (it did get better with 2.2).

The error we get is always a

> ReferenceError: relation xy is not defined

Sometimes this happens after a while of user action (so in the middle of a session). It always happens when we export a solution without having opened it first (after you opened it once, it works).

In our case this happens only with

1. global relations
2. that are defined in a module

Patrick

---

<div class="post-metadata">

**Author:** ![faheemhameed](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@faheemhameed](https://forum.servoy.com/u/faheemhameed)\
**Post date:** [November 27, 2006, 11:55am UTC](https://forum.servoy.com/t/global-relation-issue-in-startup/6785/6 "2006-11-27T11:55:58Z")

</div>

Hi Harjo,

I am setting the global value as default and also set in the startup method before using the relation.

Thanks

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [November 27, 2006, 12:14pm UTC](https://forum.servoy.com/t/global-relation-issue-in-startup/6785/7 "2006-11-27T12:14:30Z")

</div>

If I’m right we had those issue too (a long time ago) when accessing data in the startup method of Servoy.

In the start-up method, we only do GUI stuff now. As soon it is related to data, we do it in the onShow of the first form!

From that day on, we never had any problems anymore.

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [November 27, 2006, 2:25pm UTC](https://forum.servoy.com/t/global-relation-issue-in-startup/6785/8 "2006-11-27T14:25:51Z")

</div>

I tend to agree with Harjo.  
In the past these issues were known (like Patrick describes).  
They are history now.
