Wednesday, March 2, 2011

Configure and update OLAP cubes



Note: Make sure you have configuration/license keys configured, otherwise the dimensions that have no access of the field of OLTP will be removed.


Step # 1:


OLTP database synchronization of OLAP tables:


    The following procedure is used to update the BI tables that are purely related to BI cubes and used as a   dimension in the BI cubes. Before executing the procedure you need to perform some pre-requistes listed below:
1 - Go into Administration tab> Setup> Business Analysis> OLAP and click on OLAP Administration.
2 - A form will be opened.
3 - Go onto the Advanced tab of the form and mark the checkbox 'Update BI Data'.
4 - Press the button 'Update database'
You will observe that the BI related tables are filled and now these tables can be used for BI analysis after processing.


Step # 2:


OLAP database synchronization with OLTP database:

We know that OLAP has a different schema and is mapped directly to the OLTP tables in order to provide the records in OLAP cube's dimensions and measures.
Same form will be used to synchronize OLAP database. The only difference is that  here we need to provide the datasource and the server where the OLAP database schema exist. For  this task follow the steps below:
1 - Go onto OLAP Administration form.
2 - A form will be opened.
3 - Go onto the OLAP servers tab. Select the server (instance)
4 - Go onto the OLAP databases tab. Select the OLAP database.
5 - Now go onto the advanced tab, click on the checkbox Synchronise OLAP database with OLTP schema.
6 - Click update database button.
This will update the OLAP schema. Same procedure will be applied if you want database changes to be shown in OLAP schema after inserting any records in OLAP tables like CustTrans (When creating FTI), PurchTrans, LedgerTrans etc.

Soon, I will talk about how to update the OLAP database incase if you have any tables and want to use as a dimension and measures in the OLAP cubes..

Monday, August 23, 2010

Introduction to Role Center

Role Centers are default home pages for AX client and EP that provide an overview of the information that pertains to the work of people such as CFOs, CEOs, Accountants... It consist of the following web parts:

1 - Work list
2 – Activities
3 - Frequently used links
4 - Business intelligence information.
a) KPIs (Business Overview webpart)
b) KPI Reports

There is difference between the Role center page that displays on AX Client and on EP. Client Forms will not be visible and cannot be opened from the EP but can be accessed from the AX Client.

1 – Unified Work list web part:
The Dynamics Unified Work list Web part displays the list of activities, alerts, workflow approvals, and workflow tasks.
It can be added using
a - Add a web part on EP page
b – Select Dynamics AX and Select ‘Unified work list’ webpart.

2 – AX Report web part:
The AX report web part is usually used to show reports on a role center.

3 – Quick Links web part
Quick links web part provides a quick access to EP pages, reports and forms. Usually we group Quick Links into two parts.
a - Form Links
b - Report Links
AX Client Form links can be accessed only from the Role Center. AX forms cannot be accessed from the EP.

4 – Activity web part
The activity web part can be used to see the information in terms of statistical data. The activity web part shows the information according the query defined for it.

Sunday, August 15, 2010

show container values in a hierarchy

There is an existing form 'SysConView' that is used to retrieve values from container to show on a form. Here is a simple example how to show a hierarchical structure on a form. conView method is used to display container values that exist in a Global class.

container myContainer;
container myChildContainer;

myContainer = [1, 2, 3, 4, 5];
myChildContainer = [6, 7, 8, 9, 10];
/* Add a child container in myContainer*/
myContainer += [myChildContainer];
myContainer += ['Sohail'];

conView(myContainer);

Monday, August 9, 2010

union vs unionAll

There is a difference between Union and UnionAll for UnionType enum. Here is the simple example of UnionAll and Union.

lets suppose we have two sets (tables).
A = {a, b, c, e, f}, B = {g, h, i, j, k, f, c}

In the example above you can see 'f' and 'c' are common in both sets.

So, If we take Union the result would be

A Union B = {a, b,c, e, f, g, h, i, j, k}

Here you can see nothing is repeated but if we take UnionAll it will repeat both in a result set.

A UnionAll B = {a,b,c,e,f,g,h,i,j,k,f,c}

Union in a Query

There are two methods to specify QueryType and UnionType in a Query and QueryBuildDataSource respectively. You can define the fields for each datasource that you want to include in a union query.
Given below is the simple example of Union query.

static void Job4(Args _args)
{
Query query = new Query();
QueryRun queryRun;
QueryBuildDataSource qbdsCustTable;
QueryBuildDataSource qbdsVendTable;
CustVendTable mapCustVendTable;


query.queryType(QueryType::Union);

qbdsCustTable = query.addDataSource(tablenum(CustTable));
qbdsCustTable.fields().clearFieldList();
qbdsCustTable.fields().addField(fieldnum(CustTable, AccountNum));
qbdsCustTable.fields().addField(fieldnum(CustTable, CustGroup));

qbdsVendTable = query.addDataSource(tablenum(VendTable));
//qbdsVendTable.unionType(UnionType::Union);
qbdsVendTable.unionType(UnionType::UnionAll);
qbdsVendTable.fields().clearFieldList();
qbdsVendTable.fields().addField(fieldnum(VendTable, AccountNum));
qbdsVendTable.fields().addField(fieldnum(VendTable, VendGroup));

queryRun = new QueryRun(query);

while(queryRun.next())
{
mapCustVendTable = queryRun.get(tablenum(CustTable));

info(strfmt('Account num = %1, Group = %2',mapCustVendTable.AccountNum, mapCustVendTable.GroupId));
}
}

Friday, July 23, 2010

periodic call in axapta

Suppose if at the client level i want to call method periodically I can achieve this task via setTimeOut method. This method will call the method specified in the argument after the provided interval.

Suppose.

if i write the line.

this.setTimeOut(identifierstr(method1), 5000, true)

The setTimeOut method will call method1 after the 5 second when the form is idle. If we want to call method1 with the no restrictions of idle then we don't need to provide true in the 3rd argument.

this.setTimeOut(identifierstr(method1), 5000)

Thursday, July 8, 2010

fetch selected data from grid

When you are on form and want to select the selected data from the grid, You can get from the table datasource from the form by using ****_ds.getFirst(true). It will provide the reference of the respective table buffer.
for example if i select some rows from the CustTable form and I want to show it in an infolog.

Use the following Code.

CustTable custTable1;


super();

for (custTable1 = custTable_ds.getFirst(true); custTable1; custTable1 = custTable_ds.getNext())
{
info(strfmt('%1', custTable1.AccountNum));
}



If you will not provide true in custTable_ds.getFirst(), it will fetch all the records.

so to fetch all records from the grid.

change the for loop line.

for (custTable1 = custTable_ds.getFirst(true); custTable1; custTable1 = custTable_ds.getNext())