Home dynamics ax, ssrs Customized Budget Modules for IT Department in AX 2012
dynamics axssrs

Customized Budget Modules for IT Department in AX 2012

prelude

I need customized budget modules In My IT Department, so i Make a simple budget IT modules

this is how to do it

first you need to create the project, lets call it RfPjBudget

lets break down the structure before going to deep code

  1. Group SSRS
    1. list of SSRS report that we will going to use
  2. Group Class
    1. Classes that we going to use for that SSRS
  3. Group Security
    1. Menu of Form and Report that we going to use
  4. Group Jobs
    1. Jobs for uploading (importing data from excel) to budget data
  5. Group Forms
    1. Budget Entry Form
  6. Group of tables
    1. Temporary Table : RfTbTmpBudgetCalc
    2. Base Enum : RfBeMonth
    3. Extended Data Types : RfTpEntityId
    4. Table : RfTbBudget, RfTbRealisasi, RfTbBudgetTree, RfTbEntity

we going to start from point 6 (yea I know, this is not starting from point 1, but we consider this is the fastest method)

so get your coffee and start to read now

6.2. Creating Base Enum

why we creating RfBeMonth Base Enum? in indonesia, peoples like to use words betters than using number for month, so we going to create enum that translate to indonesian month

each month we create, and fill the value 1-12, it mean when we going to fill the form or report, it will show the month word

6.3. Creating Extended Data Types

in budgeting each entity budget has separated category or value, that’s why we use entity on this,

in my case, i separated each entity (business unit) in one global budget table, so my IT team can see all the budget entity group without changing the entity.

but in other case, you may change the entity concept to department concept, no different

thats why we creating RfTpEntityId as Key and RfTbEntity as master table,

6.4.1. Creating Table RfTbEntity

as I info above, this table is used in cross company, shared data between IT Department

note:

  • SaveDataPerCompany : No
  • PrimaryIndex : Index1
  • ClusterIndex : Index1
  • EntityId : Mandatory, RfTpEntityId
  • Name : Name
  • Index1 : AllowDuplicates: No, AlternateKey : Yes

Creating a Lookup methods

public static void LookupEntity(FormControl _formControl, str _filterStr)
{
    SysTableLookup          sysTableLookup;
    Query                   query = new Query();
    QueryBuildDataSource    qbds;
    ;
    sysTableLookup = SysTableLookup::newParameters(tableNum(RfTbEntity), _formControl);
    sysTableLookup.addLookupfield(fieldNum(RfTbEntity, EntityId));
    sysTableLookup.addLookupfield(fieldNum(RfTbEntity, Name));

    qbds = query.addDataSource(tableNum(RfTbEntity));
    qbds.sortClear();
    qbds.addSortField(fieldNum(RfTbEntity, EntityId), SortOrder::Ascending);
    qbds.addRange(fieldNum(RfTbEntity, EntityId)).value("!test");
    sysTableLookup.parmQuery(query);
    sysTableLookup.performFormLookup();
}

the sample data table:

6.4.2. Creating a RfTbBudgetTree Table

we make a category budget master, each budget is by tree level

the table is look like this

Fields are:

  1. EntityIf
  2. HasChild
  3. Name
  4. ParentId
  5. TreeId

 

the source code will uploaded soon

Author

Ronny

Leave a Reply