Hello Everyone,
I have a funtion that depending on what graph is calling it should do different stuff. I would like to pass the graph calling the function then compare it to some graphs and do what I need. Inside the function when I try to compare the input graph I get an error that "'Graph' is a variable but used like a type". Below is the code snippet. How can I make it work?
public static string TestFunction(PXGraph Graph)
{
if (Graph == null) return null;
if (typeof(Graph).FullName == typeof(APInvoiceEntry).FullName)
{
// Do stuff here
}
if (typeof(Graph).FullName == typeof(ChangeOrderEntry).FullName)
{
// Do stuff here
}
// and so on for some more graphs
return null;
}
I can get the graph FullName from the caller and pass to the function but I prefer not.