Thursday, September 24, 2009

Manage employee details among physical companies in Dynamics AX

If any company have multiple branches/organizations and using separate companies individually for that, then its very complicated to share certain common information among the organizations like employee, organization details, and position.
Example: Company XYZ has A, B and C organizations in deferent locations with different tax and other rules and for that they have created four physical company in dynamics.
Now they want to share some common information among these companies like they want to use a common place for employee details where all four company’s employee can be seen. They also want a common position details place which will show whole company organization + reporting structure.
To achieve this goal dynamics provide table sharing functionality which can done through virtual company.
So we have to go through by this step to do the same.
1-Have to create a new virtual company account like ABC
2-Will add XYZ, A,B and C companies in this virtual company.
4-Will Create a new table collection in AOT>Data Dictionary>Table Collection and add all employee related table which need to share like EmplTable, HRPPartyPositionTable, DirPartyInternalOrgnizationTable etc.
5-Add this table collection to virtual company account.

By doing this you will get common employee and shared table information among the companies.

Thursday, August 27, 2009

Domain, Virtual Company account and record level security

Domain: Domain is a one kind of group for company where user can add multiple companies on one domain. When we use user or user group permission this use to define same securities for added companies on particular domain
Example: If I want to provide same access to a user for company 001,002 and 003, I will create a domain like ‘123’ and will add all these three company on it and at the time of defining user group permission for a particular user or user group I will select this domain from Domain list on user group permission dialog box.
Virtual company: Domain just use to define the group for companies but all its companies works separately and if we want to share some data among the companies which we have created on system, we can create virtual company.
So we can say simply that Virtual company use to share the data among the companies and for this we have to choose the couples of table which need to share.
Example: I have two companies which have same vendors and customers and I do not want to maintain customer and vendors records separately. This time will do following steps
1-Will create a virtual company and add these two companies on that.
2-Will create a table collection and add Customer and vender tables with all its relative tables as well on that.
3-Will add the created table collection on the virtual company
Record level Security: Record level security use to define the limit of access a specific type of record from table
Example: If I want to define a limit for a user group like ‘xyz’ on vendor table where they can only see the vendors which belongs to ‘Local’ vendor group then I have to add this user group on record level security form and then by using query I will define the condition for same.

How to run a form by coding in Dynamics AX

We know that dynamics AX use menu item to call a form, AX have a simple method as ‘menufunction’ which can directly call a form with respective menu item reference.
Example:
new menufunction(("ProjTable"),menuitemtype::Display).run();

Joining database on datasouce through coding

If we want to link or join a table on existing datasouce on form have to add datasouce by using new QuryBuildDataSouce object like following example.........
QueryBuildDataSource qbdProjTable;
QueryBuildDataSource qbdProjGroup;
qbdProjTable=this.query().dataSourceNo(1);
qbdProjGroup=qbdProjTable.addDataSource(tablenum(ProjGroup));
qbdProjGroup.joinMode(Joinmode::InnerJoin);qbdProjGroup.addLink(fieldnum(Projtable,ProjGroupID),fieldnum(ProjGroup,ProjGroupID));qbdProjGroup.addRange(fieldnum(ProjGroup,ProjGroupID)).value("abc");