416
Views
2
Comments
Get Calling action name from Called action
Question

For example I have 2 actions:

Action A (Calling Action)

Action B (Called Action)

Does anyone have idea how to get name of Action A from Action B by using outsystem feature?

result should like highlighted blow




-----------------------------------------------------------------------------
// Calling Action A
void A()
{
    B();
}

// Called Action B
void B()
{
    //how to get name of Action A?
}
-----------------------------------------------------------------------------
2022-03-12 19-54-33
Rúben Leston

Hello Xin Li,

I believe that the complexity of your question may vary according to the complexity of your application because Action B may be in a different module, or even in a different application inside your environment. 

Maybe the best way to make this possible and easy, is to create an input variable in Action B. Then, when you call it from anywhere you like, you shall pass the name of the calling Action. In this case, "ActionA". There, you can do whatever you want with it, knowing that the Input Value will show you who is calling.


I hope it helps. Cheers,

Rúben

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi Xin Li,

It is not a build in OutSystems function, but with some work it is possible.

First install Forge component: https://www.outsystems.com/forge/component-overview/3046/action-info

This component uses reflection to get the action details.

You will have to call it in Action A and pass the needed info to Action B.

Regards,

Daniel

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.