≡ Menu

Suppose we are writing a custom module for Payroll. According to requirement, we have to create a custom table for Earning code. As well as Earning group.

 

At minimum we required following fields

Earn  Code Group Table

Earning Group of length 20.

Earning Group description length 60

 

Earning Code Table

Earning Code possible length 20.

Earning Code Description length 60.

Variable of fixed, If Variable the base value will be used as base percentage of Basic Salary, If fixed then base value will used as fixed amount.

Amount, The base value described as previous step.

And reference of Earning Code Group.

 

Lest explore some Extended data Type and enum and we create them with.

 

Extended Data Type:

For Extended Data Type is some kind of reusable data type based in primitive data type with some extra properties.

For example In Dynamics AX there is out of box extended Data type with “AmountCur”. It is Real based data Type. This extended Data Type usually used in amount related fields. So one of the many benefit of Extended data type is that we can change one place and it reflect where ever it used. For example, some organization want two decimal point while some required 4 decimal point. So if update decimal point at extended data type it update all fields where In our case we need to extended data Type, one for Earning code and one for Earning Group code,  For description fields we used the Out of the box field.

Now we have to create two extended data type .

2016-08-22_21-09-01

 

 

Currently I am creating objects with AL extension. So I added a extended Data type of EDT String type and name it ALEarngingCode.  Clicking on Add. A new Extended will be added in Visual studio project. Double click on it and It will open in Designer window. Right click on it and open property window and set its size properties and 20.

Size

Similarly, you can create ALEarningGroupCode

 

extendedDataType

 

 

 

Enum:

Similar there is enum is basically name of literal for example if we have Week days and enum then Sunday , Monday…. Saturday are literals.  In our current example we need Earning type as Fixed or Variable.

AddNewEnumBase

Double click on it and describe its detail on designer window

 

Add new Element

 

Double click and update Name and label.

Add name and label

Similarly add one more element

newElements

 

Tables.

Now we have to add new tables.

 

 

Now we explore some important properties of Tables in

Table types.  We can define regular table in database or required temporary table. Temporary table stay in memory until its related object stay in memory. There are two type of Temporary tables.

In memory or Temp db, In memory are usually used in report. Temp db type are used when larger data and larger processes are instantiated.

In current example we use the regular tables.

 

 

 

 

 

 

 

Now add new tables First we create ALEarningGroup and then AlEarningCodes.

Add new item in visual studio and select table from add new Item dialog.

New Table

 

Set table name as as AlEarningCodeGroup, right click on table object in designer window solution explorer and open set table type as regular.

TypeGroup

 

 

 

 

Now add two fields  with EarningCode and Description of string type

 

Fields

 

 

 

 

EarninCodeGroup

 

DescriptionProperties

 

 

 

 

 

 

Now expand field group and add new group Named to Grid and drag both fields into it

EarnCodingDetailss

 

 

 

 

 

 

Similarly create another table for EarningCode

 

Add two fields AlEarningCode and fields EarningCode and description.

earningCodeTable

Now add one more field with type Enum

EnumField

Set its name EarningcodeType  and set its enum Type to AlEarningCodetype, We created this enum type in previous steps.

EnumSelection

 

 

Now add one more field with real type and set its

 

 

EarnCodeAmountCur

 

 

 

similarly create a Field group name Grid and drag all fields there.

EarnCodeTableee

 

Add one more string type for EarningCodeGroup we will map this field with Earning Code table for primary and foreign key relationship.

WithEarningCodeGroup

Indexes – are a way to speed up retrieval of data from a table

 

There are three types of Index in New Dynamics Ax.

A primary Index. This will provide the unique key to each record.  And field used in primary index used as primary or alternative key for table.

Second one is Clustered and not Clustered which are not scope of this post, we will discuss them in later post.

A clustered index organizes the data in the table in the order of the index.

Non-Clustered index is some kind of reference stored somewhere else to pointed to data. Example of the book index, placed at the end of book, reference of sorted title with page number.

Now we create Index in AlEarningCodeGroup table and then AlEarningCode

EarningCodeGroup

Update the following properties to    Alternate Key Yes, Allow Duplicates to now and set its name as idxEarnGode p

 

Index

Now drag EarningCodeGroup Under index.

 

IndexGroup

Now open table properties and add following  update Primary Index  to IdxEarningGrpCode and also select

IndxGroupProperties

Similar create index in ALEarningCodes

EarningCodeTableIndex

 

 

Table Relationship

There are two types of relationship in new Dynamics ax.

The first relationship type is called a normal relationship.  A normal relation is used to specify a relation without any conditions.

Another type of relation is called a foreign key relation.  This is used to specify a correspondence between a foreign key field in the present table to the primary key field in another parent table.  Foreign key relations are usually set on a child table.

In our current Scenario, we want to we want EarningGroup code as reference in EarningCode table. For this we expand relationship node of AlEarningCode and add new Relation based on Primary key relation

PrimaryRelation

Updates relation Name and also select related table

RelationProperties

 

Save it again right click and Select Normal relation

 

PrimaryKeyRelationDetails

 

Click on Related Field fixed.

FieldSelectionInRelation

Now from selected screen select both related fields.

Save It compile, so Tables will be synchronizing to database.

 

In next post we will build simple data entry forms on these two tables.

 

{ 0 comments }

 

I used following code snippet to get financial dimension attached with hcmposition

 

static void GetFinancialDimensionValue1(Args _args)

{

HcmPosition  position;

HcmPositionDefaultDimension  positionDefaultDimention;

DimensionAttributeValueSetStorage dimStorage;

Counter i;

select * from position

join * from positionDefaultDimention

 

where position.PositionId=="000001"

&& position.RecId == positionDefaultDimention.Position;

 

 

 

dimStorage = DimensionAttributeValueSetStorage::find(positionDefaultDimention.DefaultDimension);

 

for (i=1 ; i<= dimStorage.elements() ; i++)

{

 

info(strFmt("%1 = %2", DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name,

dimStorage.getDisplayValueByIndex(i)));

 

}

}

2016-08-15_23-14-22

 

Reference:  https://jkmsdax2012.wordpress.com/2015/11/16/how-to-get-financial-dimensions-for-a-particular-customer-using-x-code-in-ax-2012/

{ 0 comments }

today I got this error while running a custom report.

Cannot edit a record in  Table

An update conflict occurred due to another user process deleting the record or changing one or more fields in the record.

 

 

I found that this error occurs due to concurrent access to table is allowed. And we did not need concurrent access.

I change the ccEnabled to no

Concurrent

 

 

If this error occur on table that can be used on concurrent mode, then write tableBuffer.reread() before adding or modify data.

 

 

Reference: https://community.dynamics.com/ax/f/33/t/95177

{ 0 comments }

Hi, all very small tip today, Recently I have to add water mark in one of custom report.

In SSRS for Dynamics Ax 2012, we can achieve water mark by adding background image in report body.

Water mark image should be small in size and used as background Image. If you use high in size image, Report will threw errors on deployed at server.

This water mark can hide and show with ssrs expression.

So complete real word requirement will be Print report with water mark if certain criteria meets, other wise print report normal report.

 

At SSRS side right right  click on report Body and click on Body Properties.

2016-08-04_11-38-16

From property window, select fill, select file the image source “embedded” and import file.

Import

After import file will be shown as report explorer

 

Duplicate

Now add following expression  to show report display water mark or not.

 

=IIf(Fields! DuplicateCopy.Value=1,”Duplicate3″,””)

{ 0 comments }

 

 

In new Dynamics Ax, the extensions are created for extension. Previously we use overlay or overwrite change in Out of the box Dynamics Ax object. For example, if we have to add some fields or modification we are overlay or adding changes in original Object. Object is overwrite in configured layer. But in new Dynamics Ax we create extensions. And we added changes in extension. And run time all these extension run as single object.

 

This is post is third in series, you can also view previous two posts as follow.

Customization In New Dynamics Ax (AX 7) Part 1 – Creating New Model

Customization in New Dynamics Ax (Aka 7)- Create New Module

 

 

 

Consider the scenario, that we writing our custom payroll and here is customer wants direct two 3 fields in Worker details.

  • National Identification Number.
  • Passport Number.
  • Passport Expire date.

 

For this we create extensions and add required fields in table. So expand Tables in Application explorer.     Right click on WorkerPersonalDetail table and click on extension.

Table extension2

 

 

 

 

 

 

New extension is created and double click on it a
ExtensionDetails

 

 

Before that Right click on Project and set Data Base Synchronize properties true.

Visual Studio Properties

 

New added two string of length 20 character and added expire date and set extended data type of FromDate.

GroupDetails

Add new group

NewGroup

 

 

Set properties

PasportGroup

Drag new fields in it.

GroupDetails

Now build project to synchronized to data base.

 

Now expand Forms and HcmWorker and creates it extension.

FormExtension

 

Double click on form extension and open it in designer

 

Expand

 

 

Expand he deign portion until you reach the control, where you want to add required field. for example I want to add New fields in PersonDetail section.

ExpandDesigner

 

Expand profile Tab page and add new group as NIC and Passport.

FormNewGroup

Set its data source and data group as follow

New Fields

Save and Run Project by Ctrl+ F5.

Detail Page

 

On click and edit mode

 

Edit

 

Now we add values and save them

Values Save

{ 0 comments }

This post is continuity of

Customization In New Dynamics Ax (AX 7) Part 1 – Creating New Model

In Dynamics New module is a Menu,

 

In this post we are Creating A new module In Dynamics where we add complete implementation.

 

So first step to create a menu Item

CustomMenu

Double click on menu and open it in design area,

 

 

 

 

Designer

 

and then right click on it and update its name and label as follow

MyCustomPayrollProperties

Now add new Menu item,

menuDisplay

 

and Set its form properties to HCMWorker.

 

MenuDisplayProperties

 

 

 

Now drag open again menu in Design screen and drag display menu from solution explore and save it.

Drag

 

Now expand the Main menu in AOT and right click on it and click on generate Extension in current project

Extension

 

You can see new extension in with MainMenu.Extension in solution explorer.

New Extension In Solution Explorer

 

 

Double click on It and open it in designer and then right click on it to create a new menu reference

 

NewReference

 

 

ReferenceMenuName

 

 

 

Rename reference menu and set its menu properties to Menu which we create in previous step.

 

ReferenceProperties

 

Because we are doing this is post is as introduction, so we set display menu target to HCMWork set it as starting object in Visual studio project.

 

VisualStudioProject

Now compile, and Run Project With Ctrl+F5.

You can find our custom menu is appeared in Main menu.

MainMenu

 

 

 

 

 

 

 

 

{ 0 comments }

Currently I am explore my Dynamics Development Skills in new Dynamics AX (Aka AX 7). So I decide to write series of post.

So first post is about creating Model and visual studio project.

Open Visual studio but did not create project, first step is Create new model. For this click on Dynamics AX menu and click on Create Model.

2016-07-25_1-24-11

 

 

Suppose we write our custom payroll so I wrote Model name with payroll.

 

Write some something in Model Description.

2016-07-25_1-35-16

In next step select Application suit.

Application Setup

Select and click on next.

 

Let this step to complete it, it will ask you to create a new Visual studio Project Select that option to create a new project, set its name Custom Payroll.

Dynamics Ax solution

 

 

{ 0 comments }

Interesting, I was modifying some RDP based report, I found that parameter was passed to report through custom table, As report will run form button, and based on current selected record. So former developer did that on pressing button, selected value inserted some custom table. When report run, query on table and fetch required value form custom table and whole report logic run on that value. That approach works fine, single user environment. Problem I found to send parameter to report through x++ code. I found SrsReportRunController works wonder here.

Suppose we are running some report for customer, And Report Name is customer Report and we have to pass current customer account on form as parameter. If you report is based on Report data provider than following code snippet works for you.

 

 

 

SrsReportRunController          controller = new SrsReportRunController();

CustomerReprtDC  rdpContract = new CustomerReprtDC  ();

SRSPrintDestinationSettings     settings;

super();

controller.parmReportName(ssrsReportStr(CustomerReport,CustomerCopy));

 

 

controller.parmShowDialog(false);

rdpContract.parmCustAccount(CustTable.AccountNum);

controller.parmReportContract().parmRdpContract(rdpContract);

controller.startOperation();

{ 0 comments }

 

 

Suppose we have to hire a Ax Dynamics Ax Technical consultant in new Dynamics AX (AKA).

There are multiple ways to do that, but we follow these steps.

2016-06-04_10-09-57

For this we have follow following steps. We explore, Job creations, we create skills, education and certification required for this job, later we create position and attach it to job. Than create a recruitment project where we mentioned who is HR Manager, who is recruiter and create a new application and hire the required person.

 

We can divide the whole process into following parts

  1. Create a new job
  2. Create a position and associate with job
  3. Create a new recruitment project for job.
  4. Hire a new worker against Recruitment Project.

 

 

 

 

 

 

 Create  a new Job.

2016-06-04_11-36-23

After successful login

 

and from menu open the HR module

2016-06-04_11-44-22

 

 

 

 

and expand it and click on Jobs.

Job

 

On click  a new web page opens, that shows the list of jobs present in Dynamics Ax. Now Click on new button.

Job list page

In a new Job detail page, enter, Dynamics Ax consultant in job , In description, mentioned “Dynamics AX techno Functional Consultant” And Title select Consultant. You can also set

Job details

You can also Expand Skills fast tab and add new skill, If skill is not available for example in my current scenario, X++ and supply chain is not preset so on skill text box right click and click on view details.

Add new Skills

You have to add rating also the same way.

 

New skills Rating

 

When skills are added, I select them in skill section.

Details

Next step is to add certification, Here requirement is that Person must have certification.

McP Certification

So right click on certification and create new certification and then select it.

MCP selection

 

 

 

Add new Education, suppose we require to person at least Graduate. So select graduation.

Bsc Computer

 

 

 

Now we have to add three task, that belongs Customization, integration and code.

Skill selection

 

 

Save the job from top menu and close the job

If we see on list page, we find our new job is listed there

 

New job is created

 

 

 

 

 

.

 

Create the new position

 

Now second step is Position creation and attach job with it.

From menu, select position.

Position Menu

 

On list page, from top menu, Click on new

New position

 

 

 

Select Job we created in last step.

New Position detail Page

 

 

 

 

 

You find the now position associated with job in position

Create

New position is listed on list page

New Position List page

 

Create a Recruitment Project.

 

Now go back to Main menu and create a new Recruitment Project

 

Recuriement Project Menu

 

 

Form list page create new recruitment Project by clicking on new at top menu.

New Recuritment Job

 

Select Previously Created Job and save the Recruitment project.

Recruitment Project selection

 

From top menu click on and start the Recruitment Project

Click on start

 

 

Hire new employee against recruitment project

New recruitment project is started, we can receive application against this

Start Project

 

From top menu click on applications.

Create Application Menu

 

Select the applicant name, In my current scenario, required Applicant name was not exists in ERP. So I right click on Name field and click on View Details.

New Applicant

 

 

From New party page enter the Required name and create a new party.

New Person detail

 

After that save and select newly created party as new applicant.  Right click on top menu. And hire new worker.

Application Status and

 

 

If select employee from menu.

 

333d

 

 

Click on Hire button to create new worker, the applicant successfully Hired against job.

 

{ 0 comments }

Yesterday I deployed the new SSRS customization to staging, so QA / Functional guy can test.

Client configured the AOS to Database server and Application server was moved for backup services.

Due to change in AOS server I have to face two issues.

“No Such Host is known.”

2016-07-12_9-33-00

Whenever we run the report on staging server during report processing Error pop up appear with message “ Host not found “.

 

Modification in Windows Register, did not solve this problem. I have to reinstall the Reporting services extension form Dynamics Ax 2012 R3.

Reporting Server Extension

 

 

Second issue I faced that During installation of Reporting Extensions. Setup did complete and shows message about it did not locate the Required AOS. Interesting setup pointing to old server.

AoS problem

 

I solve this error by removing the credential save for Business connecter form Administration module for Dynamics AX. After rerun the reporting extension form AX Setup, Installation will complete successfully. Later deploy all reports and reports runs successfully.

 

{ 0 comments }