Global_context?

Hi Again Folks:

Again, forgive the newbie questions. I was able to define a relationship against a table listed as “global_context” in the relationship setup window. I set the relationship up to parent off of one of my Global fields.

It seems to work OK, but I could not find any reference to “global_context” in the documentation. Can someone point me to some documentation on this? Want to be sure I’m using this properly.

Thanks,
Lee

I’m not 100% sure I understand what you mean.

When you create a relation that contains a global field on the left side - it will automatically show up in the “global” scope. If you create a relation that does not have a global field, it won’t. You use a global in a relation to make it more dynamic.

Likewise you can create methods in the global scope and attached to a form. My way of knowing when to do which is: I ask myself “am I going to re-use this code anywhere else in the solution?” If the answer is “YES” - then I make a global method. If the answer is “NO” - then I make a form-based method.

Hope this helps.

bcusick:
I’m not 100% sure I understand what you mean.

When you create a relation that contains a global field on the left side - it will automatically show up in the “global” scope. If you create a relation that does not have a global field, it won’t. You use a global in a relation to make it more dynamic.

Likewise you can create methods in the global scope and attached to a form. My way of knowing when to do which is: I ask myself “am I going to re-use this code anywhere else in the solution?” If the answer is “YES” - then I make a global method. If the answer is “NO” - then I make a form-based method.

Hope this helps.

Hi Bob:

I understand the concept of Globals and Global methods. When I setup the Global relationship, I got a table name in the relationship listing called “Global_context”? I just was looking for a reference to this “Global_context” in the documentation.

Also, I note that you can have Globals included in your relationships, which can be mixed with “real” data fields. I just wanted to be sure this is all part of the intended design. It all seems to be working OK so far, but I don’t want to break any rules or best practices, or use a feature in a way that was not intended.

Thanks,
Lee

You’re not doing anything wrong.

What “table” do you mean? In the relations listing? Can you do a screen shot? What version of Servoy?

Hi Bob:

I sent a screen shot via email.

Thanks,
Lee