RSS

Tag Archives: X++

Compile Whole AX Code in less than 30 min AX 2012 R2

Hi All,

With the release of cumulative update 7 for Microsoft Dynamics AX 2012 R2, Microsoft has launched a new command line tool to compile the complete X++ code. This tool has reduced the compilation time and 13 times faster. It can compile the whole AX in 30 mins.

For further details,

http://msdn.microsoft.com/library/d6da631b-6a9d-42c0-9ffe-26c5bfb488e3.aspx

Advertisements
 
Leave a comment

Posted by on November 10, 2013 in AX, Basics, X++

 

Tags: , , , ,

Image

Using table method on Document Handling generation via COM

Hi Guys,

I just got a chance to work on creating document using word or excel template. in Dynamics AX we have a very good feature in document handling Create Word document via COM or Create Microsoft Office Excel worksheet via COM. Using these features we can create word or excel template, and create and attached the document to the record filling the template fields from the table record.

I don’t want to explain how to setup this type of document, you can read the blow link for that,

http://technet.microsoft.com/EN-US/library/aa548928.aspx

The problem arises when i try to use the the field which is not on the table or don’t have a direct relation with the table i have setup. For example, i have used the SMAServiceOrderTable and i have requirement to fill the “Payment term” on the template, which is on the ProjInvoiceTable. Which has a relation with SMAServiceOrderTable through ProjTable (SMAServiceOrderTable->ProjTabe->ProjInvoiceTable).

The solution i think for this problem is to customize Document handling feature to have the provision of using the method of the table instead of just the fields.

So the problem solved, I added a field on the “DocuField” table for methodName modify some classes. I have provided the link for the XPO for that.

XPO,

https://docs.google.com/file/d/0B7b9JMHh3V2eYnpaSldVNTg0TFE/edit?usp=sharing

I have modified the DocuField table so that method name of the table can be specified.

Then i make changes on the \Classes\DocuActionTrans\insertField  method, to get the value from method using DictTable class.
Thanks for Reading.

 

Tags: , , , , ,

Dynamics AX2012 Fact boxes

Fact boxes in Dynamics AX2012 is another very pretty feature. Before writing anything see the below screenshot of the Customer Listpage.

The area in the red box are the fact boxes, which are new in AX2012. These fact boxes provides extra information of the selected record for example the related information fact box shows the quotation, invoices of the customer selected. By this feature user don’t need to move to other form to get the information. User can get the summarized view of extra information in the fact boxes.

On AOT, there is a new node called “Part”, which holds the fact box objects. The available type of fact boxes are,

  • Form part
  • Info part
  • Cue part
I will provide more detail about how to develop fact boxes and place it to any form. Fact boxes can be placed on on listpage or forms.
Wait for my new post to know more about fact boxes. Keep reading my posts.
 

Tags: , , , , , , , , , , ,

Dynamics AX 2012 EP Session video

Enterprise Portal is one of the most attractive feature of Dynamics AX 2012. Enterprise Portal for Microsoft Dynamics AX provides a Web-based application framework that allows for users to interact with data in Microsoft Dynamics AX through a Web browser.
I shared this video to have the understanding of the development of EP in AX 2012.

see the video by clicking the below link.

http://vimeo.com/26902748

 

Thanks & Regards.

 

 

Tags: , , , , , ,

Delete Action

Cascade

A cascading delete action will delete all records in the related table, where the foreign key is equivalent to the primary key of the current table. That is, deleting the parent record will also delete the child record(s) in the related table. This cascading will take place whether the deletion is performed in code or directly by a user through the user interface.

Restricted

A restricting delete action will raise an error message if the user tries to delete a record, where records exist in the related table where the foreign key is equivalent to the primary key of the current table. This error will only appear if the deletion is performed through the user interface. A deletion from X++ code will be allowed to proceed and will not be cascaded to the related table. In this case the programmer should call .validateDelete() themselves prior to the call to .delete()

Cascade + Restricted

The delete action performs a restricted, if the record of the table will be deleted directly and performs a cascade, if the record of the table will be deleted through a cascade delete action of a other table.

 

Thanks for reading. keep visiting and giving feedback.

 
Leave a comment

Posted by on February 7, 2011 in AX, Basics, X++

 

Tags: , , , ,

Exceptions Inside Transactions

When an exception is thrown inside a transaction, the transaction is automatically aborted (a ttsabort operation occurs). This applies both for exceptions thrown manually and for exceptions thrown by the system.

If an exception is thrown inside a ttsBegin/ttsCommit block, it will be caught by the first matching catchlist that is outside the transaction block. If there is a catch block within the ttsBegin/ttsCommit, it will be ignored

 

Example

Example  shows how an exception in a ttsBegin/ttsCommit block is caught by the first catchlist outside the block rather than by the catch within the ttsBegin/ttsCommit block. If you run this code, “outside tts” will be printed before an Infolog displays “Message”.

try

{

ttsbegin;

try

{

throw error(“Message”);

}

catch

{

print “not here”;

pause;

}

ttscommit;

}

catch

{

print “outside tts”;

pause;

}

 

Source: http://msdn.microsoft.com/en-us/library/aa893385(AX.10).aspx

 
2 Comments

Posted by on January 20, 2011 in AX, Basics, Dynamics, SQL, Tables, X++

 

Tags: , , , , , ,

RecordSortedList and RecordInsertList

For those who are wondering, Is there any way in AX to reduce the client server call when inserting a bunch of records into the database. With no surprise Yes!, AX provides a way to do that. Two Collection classes are there in AX RecordSortedList and RecordInsertList for this purpose.

The RecordSortedList class inserts multiple records in a single database trip, and can hold a subset of data from a table, in a particular sort order that does not exist as an index. There are built-in methods in RecordSortedList which can be used to perform the insertion to database. You must provide the sort order in order to perform the insertion properly. The following code sample demonstrates how to insert multiple Student records in the same database trip, using RecordSortedList:

 
 

Student student;

RecordSortedList recordSortedList = new RecordSortedList(tablenum(Student));

recordSortedList .sortOrder(fieldname2id(tablenum(Student),’StudentId’));

 
 

student.clear();

student.StudentID=”123″;

student.FirstName=”DOM”;

student.LastName=”FED”;

recordSortedList.ins(student);

 
 

student.clear();

student.StudentID=”456″;

student.FirstName=”TOM”;

student.LastName=”GED”;

recordSortedList.ins(student);

 
 

student.clear();

student.StudentID=”789″;

student.FirstName=”ROM”;

student.LastName=”TED”;

recordSortedList.ins(student);

 
 

recordSortedList.insertDatabase();

 
 

The RecordInsertList class provides array insert capabilities in the kernel. This allows you to insert more than one record into the database at a time, which reduces communication between the application and the database.

RecordInsertList is similar to RecordSortedList, but it has built-in client/server support (it automatically packs data from one tier to another when needed), and it lacks the sort order features available in RecordSortedList.

 
 

The following is an example using RecordInsertList

Student student;

RecordInsertList insertList = new RecordInsertList(student.TableId, True);

int i;

 
 

for ( i = 1; i <= 100; i++ )

{

student.StudentrId = “F”+int2str(i);

insertList.add(student);

}

insertList.insertDatabase();

 
 

Let me know if you guys have any queries. I will appreciate your comments and feedback.

 
2 Comments

Posted by on December 30, 2010 in AX, Basics, Dynamics, Framework, Tables, X++

 

Tags: , , ,