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));
}
}