RSS

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.

 

Advertisements
 

Tags: , , , , , ,

Dynamics AX EP Session

Hello Guys,

I have presented a session on the Dynamics AX Enterprise Portal. See the attached presentation. I will share the video of the session very soon.

Keep reading and visiting the blog.

Share What you have learned – EP

 

 

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: , , ,

Working with Multiple Datasource on a single Form

Today we will discuss how we can display records from multiple datasources in a single form. Data sources on a form allow the form to display the data from the table specified on the data source. A table in a data source can be sorted and filtered by the user, which is an important feature of Microsoft Dynamics AX.

Forms can have multiple data sources, and each data source can be joined to another data source on the form using the defined relations between the tables. Relations or Dynalinks can also be added in the form code.

A form data source produces a query that can be manipulated in the same way as any other query in the system.

If you wish to display records from two tables on one form, you can limit the records in one of the tables to the related records in the other table. You can do this by specifying a join between the two tables. The join is specified on the JoinSource property of the second or joined table. Here you should enter the data source name of the main data source. You can also specify the type of join.

 
 

The following table describes the types of join available:

  • Passive: The query on the joined data source is only executed when the form is opened. A later change in the controlling data source does not change the view.
  • Delayed: The query on the joined data source is executed every time that the controlling data source is changed. The query execution is delayed to avoid the fetch of data, if the controlling data source is changed multiple times in a short time. This is the case when the user is scrolling through data on a grid.
  • Active: This option is similar to Delayed, except there is no delay before the query is executed.
  • InnerJoin: Selects records from the main table that have matching records in the joined table and vice versa. If the joined table does not have any records related to the main table record, the main table record is not displayed. Each match returns a result set of the main table record and joined table record joined together as one record. This is useful when wanting to display records from both tables in a grid.
  • OuterJoin: Selects records from the main table whether they have matching records in the joined table. Each match returns a result set of the main table record and joined table record joined together as one record. If there is no match, the fields from the joined table will be empty.
  • ExistsJoin: Selects a record from the main table only if there is a matching record in the joined table. As soon as a matching record is found, the main table record is returned. The record in the joined table is never retrieved.
  • NotExistsJoin: Select records from the main table that do not have a match in the joined table.

     
     

Using these two properties JoinSource and LinkType on the child Datasouce of the form you can display your desired result from multiple datasource. I hope that clears the use of these two properties to display record from multiple datasources.

 
1 Comment

Posted by on December 28, 2010 in AX, Dynamics, Forms, Tables, X++

 

Tags: , , ,

Read XML file in AX

This post will not take your lots of time, just giving you one example to make you understand how can we read XML file. This post will enable you to read a file that is in the same format as the example in the previous post. You can try on your own to create a Job that reads an XML file that uses attributes such as the second example in the

previous post.

 

static
void ReadXml(Args _args)
 

{

XmlDocument xmlDoc;

XmlElement xmlRoot;

XmlElement xmlField;

XmlElement xmlRecord;

XmlNodeList xmlRecordList;

XmlNodeList xmlFieldList;

CarTable carTable;

DictTable dTable = new DictTable(tablenum(CarTable));


int i, j, fieldId;

#CarsXmlTags


// Create an XmlDocument object to hold the


// contents of the xml-file

xmlDoc = new XmlDocument();


// Load the content of the xml-file


// into the XmlDocument object

xmlDoc.load(@”c:\temp\cars.xml”);


// Get the root node

xmlRoot = xmlDoc.getNamedElement(#CarRootNode);


// Get all child nodes (records)

xmlRecordList = xmlRoot.childNodes();


// Loop through the list of records


for (i=0; i<xmlRecordList.length(); i++)

{

carTable.clear();


// Get the current record from the


// record list

xmlRecord = xmlRecordList.item(i);


// Get all child nodes (fields)

xmlFieldList = xmlRecord.childNodes();


// Loop through the list of fields


for (j=0; j<xmlFieldList.length(); j++)

{


// Get the current field from the


// field list

xmlField = xmlFieldList.item(j);


// Set the matching field in the carTable


// to be equal to the inner text


// (the text between the tag and end tag).

carTable.(dTable.fieldName2Id(xmlField.name())) =

xmlField.innerText();

}


// Insert the record into the carTable

carTable.insert();

}

}


 
Leave a comment

Posted by on December 27, 2010 in AX, Basics, Dynamics, Tables, X++, XML

 

Tags: , ,