I'd like to have some common logic shared between two screens, so I want to have an abstract class inheriting from PXGraph, and then two different Graphs inheriting from this abstract class.
Like this :
namespace LE
{
public abstract class ICarrySomeLogic : PXGraph<ICarrySomeLogic>
{
// common business logic
}
public class graph1 : ICarrySomeLogic
{
// specific business logic
}
public class graph2 : ICarrySomeLogic
{
// specific business logic
}
}
I have done this before and works great. Here is my example simplified...
public abstract class MyGraphBase<TGraph, TPrimary, TWhere> : PXGraph<TGraph, TPrimary>
where TGraph : PXGraph
where TPrimary : class, IBqlTable, new()
where TWhere : class, IBqlWhere, new()
{
public PXSelect<TPrimary, TWhere> document;
}
public class GraphOneEntry : MyGraphBase<GraphOneEntry, MyDac, Where<MyDac.docType, Equal<DocType.typeOne>>>
{
}
public class GraphTwoEntry : MyGraphBase<GraphTwoEntry, MyDac, Where<MyDac.docType, Equal<DocType.typeTwo>>>
{
}
My events in the base abstract class will fire and I can override as needed in the other graphs.
I have been using this since version 5.3