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
- Group SSRS
- list of SSRS report that we will going to use
- Group Class
- Classes that we going to use for that SSRS
- Group Security
- Menu of Form and Report that we going to use
- Group Jobs
- Jobs for uploading (importing data from excel) to budget data
- Group Forms
- Budget Entry Form
- Group of tables
- Temporary Table : RfTbTmpBudgetCalc
- Base Enum : RfBeMonth
- Extended Data Types : RfTpEntityId
- 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:
- EntityIf
- HasChild
- Name
- ParentId
- TreeId
the source code will uploaded soon