Skip to main content
Answer

How to check if an action name exist within a graph?

  • January 10, 2023
  • 2 replies
  • 177 views

aaghaei
Captain II
Forum|alt.badge.img+10

Hello all,

I need to check in a graph an Action Name exist so I loop through the actions but I am unable to get the Action name. Can someone help me out here?

for (int actionID = 0; actionID < Base.Actions.Count; actionID++)
{
string actionName = Base.Actions[actionID].ToString();

if (actionName == "MyButton")
{
//Do Stuff
}
}

 

Best answer by MoulaliShaik79

Hi @aaghaei,

After spending a couple of hours, I came to know that by using the below code, We can get all the ActionNames from the current Graph.

            foreach (var act in e.Cache.Graph.Actions.Keys)
            {
                var actionName = act;
            }

 

The below one is from ServiceOrders Screen:

 

 

 

I hope it helps you!

Moulali Shaik.

 

 

 

 

 

2 replies

Forum|alt.badge.img+1
  • Semi-Pro II
  • Answer
  • January 11, 2023

Hi @aaghaei,

After spending a couple of hours, I came to know that by using the below code, We can get all the ActionNames from the current Graph.

            foreach (var act in e.Cache.Graph.Actions.Keys)
            {
                var actionName = act;
            }

 

The below one is from ServiceOrders Screen:

 

 

 

I hope it helps you!

Moulali Shaik.

 

 

 

 

 


aaghaei
Captain II
Forum|alt.badge.img+10
  • Author
  • Captain II
  • January 11, 2023

Thank you @MoulaliShaik79 Appreciated for the time.