Loading ...

How Pages In Acumatica Work

Hello Everybody.

Today I will speak about some trivial matters, which I found during usage reflector while analyzed received source code of acumatica.

So lets go on.

Each page of acumatica as base class PX.Web.UI.PXPage.

Base page has the following declaration:

public PXDataSource DefaultDataSource; 

This explains why we need to describe graphe for DataSource. 

Inside of disassembled code I found method IsPageCustomized, which looks in folder CstPublished in order to ched did page was customized.

Another interesting feature is method OnInit which is overrided. It means that Acumatica adds controls to page by itself which is correct from viewpoint of ASP.Net pages lifecycle.

But let us add some goal in code digging. Which part of Acumatica responsible for loading data? I assumed that PXDataSource and moved to that part. For me it was interesting to notice there ExecuteSelect method.

If to look on it looks like it is used in order to get something from DB:

internal override IEnumerable ExecuteSelect(string viewName, DataSourceSelectArguments arguments, PXDSSelectArguments pxarguments)

What I noticed specially is string viewName, which maybe corresponds to view in Graph class, while I still not sure. I decided to search for property TypeName. And I found that it is located at class PXBaseDataSource. 

Also at that class my eyes were catched by such interesting string array declaration:

 private static readonly string[] ag = new string[10]

    {

      "cancel",

      "save",

      "insert",

      "delete",

      "first",

      "last",

      "next",

      "previous",

      "prev",

      "copypaste"

    };

And look at this!!!! We can find how Acumatica declared graph and how it loads it:

[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

    [Browsable(false)]

    public PXGraph DataGraph

    {

              bla bla bla

     }

bla bla bla means the following:

1. If design mode, then goes some actions, which for now doesn't have much interest for me.

2. If not design mode, then goes some staff, which confuses me. 

But lets see by details:

if (this._DataGraph != null) 

and the goes code which created graph.

After that I went to class PXGraph, and found that PrimaryView property is declared there. 

Well. Still it wasn't point of interest for me. So I moved to another class: PXGrid. But that will be another post