Get refering espace

Get refering espace

  
Is there a way to get the referring eSpace in an action?

Kind regards,
Matthias Preuter
Hi Matthias!

I'm not sure I understand what you want, so I apologize for giving you two distinct solutions.

If you're trying to know which eSpaces are consumers of the current eSpace, then I'd say that the information for that can be retrieved by referencing the "Espace" and "Espace_Reference" System entities, and by querying them.

If, on the other hand, you are trying to know in runtime which eSpace is invoking that action, then I'd say that you have to create an extension action that accesses either the .Net Application context, HTTP context or OutSystems' OS context. Somewhere inside those objects you'll be able to find something that might tell you what you want - either the Application's name, folder ("\Enterprise"), or in the case of the OS context, the eSpace Id or tenant name.

I've done something like that a couple of years ago, in version 4.x . Hopefully it hasn't changed much!

Let me know if this helps.

Best regards,

Paulo Tavares
Hi Matthias,

Adding to what Paulo has said you can also try to use the GetOwnerURLPath() function.

Cheers,
Tiago Simões