Linkedin Profile

https://www.linkedin.com/in/hafiz-usama-a2111195

Wednesday 19 April 2017

Duplicate type with name ‘Dynamics.Ax.application.TableName

Hello All,
Recently I faced really a weird issue. I was trying to import a simple project in AX 2012 and it was giving annoying error on import of a table "Duplicate type with name ‘Dynamics.Ax.application.TableName". When I tried to generate CIL it gave me the same error again and CIL couldn't be completed.
Later on it stopped system AIF services too. 
So I followed below steps to resolve the issue:

1) Stop AOS service.
2) Delete all files on the AOS server under C:\Program Files\Microsoft Dynamics AX\60\Server\<aos instance name>\bin\XppIL
3) Connect to the model db via SQL Management studio
4)Truncate the table SYSXPPASSEMBLY which lists all of the files found in step 2
5) Start AOS service
6) Run Full CIL

and the issue is resolved. Keep Daxing !

Get old value of AX table Field

Hello Folks,

Hope y'all are doing well.

I was working on a requirement where I had to use previous value of a column.
For Example there are 2 columns in table Coulmn1 (Editable) and Coulmn2 (Non Editable). 

And, Column2 = Column2 + Column1.

Lets discuss a scenario, Column1 = 0 and Column2 = 5
we edit Column1, Now :Column1 = 5 and Column2 = 10
lets edit it one more time: Column1 = 10 and Column2 = 20 which is wrong, it should be 15.

I needed previous value of Column1 so I can subtract it from Column2 to get original Value of Coulmn2. For this, there is a method named 'orig'. I used it in modified Field Method and Implemented it like this
tableBuffer.Column2 = (tableBuffer.Orig().Column1 - tableBuffer.Column2) //returned original //C1 Value + tableBuffer.Column1;

Keep DAXing.

Sunday 12 February 2017

Set up title of Form in AX 2012

Hi,

Today I am gonna show you how to set the title by selected record in Detail form.


For example in Sales Order Detail Form at title bar you see information of Sales Order Number and Customer Name.




1) This is done by setting the Table (datasource of form) property TitleField1, TitleField2.






2) And then go to Form Design. Set the Title DataSource property of design with the data source whose titlefields you just set.




Get newly added field in Form

Hi,

Today I am going to show you how you get newly added field in Form to display.

When we add a new filed in a table it doesn't show in Form Datasource automatically. We often wonder what to do.

You just have to go to that form , Right click and Click on restore button.



Thanks.

Keep Daxing !

Saturday 11 February 2017

Get start and end of month

Hello,

Today I am going to show you how you get first and last date of month from a date.

Here is how:



Thanks.

Keep Daxing !

Showing message box in AX

Hi,

Today I am going to show you how to create a message box in MS Dynamics AX.
Its quite simple, but if you are new to AX you need to see this.

AX supports many types of message boxes among them 3 are commonly used. They are.

Info (To show information like operation completion etc.)
Warning (To show warning messages)
Error (To show error)

All 3 of them are same but only the box is a little different.

Syntax :



  • Info('This is usama's blog.');
  • Warning('Pay attention.');
  • Error('You didn't pay attention.');


Extensive:

If you need to show any value of variable in message box you will use strfmt in info. This is how its done:

Info(strfmt('%1 total record inserted', variableName));

Thanks.

Keep Daxing !