Monday, September 10, 2007

Question :
When using index (not using hint) in a select statement without 'GroupBy' or
'OrderBy' in what sequence do the records occur

Answer:
When using Index hint, the index chosen is hinted to the SQL server as the
one that should be used for the query.
(you shouldn't use this unless you are very sure that's the best selective
index there ever will be for the table)

the index (without hint) is interpreted into a simple ORDER BY clause, so
the records will be ordered in the order of the fields from the index.

( you can turn on logging SQL statements and see the actual query being sent
to the server)

Why to call update

Question
This does not updates the table
AssetParameters asset;
;
asset =AssetParameters::find(true);
ttsbegin;
asset.AutoNumber=NoYes;
ttscommit;
------------------------------------------------------------------------------------------------But
the following code updates the table now the question why there is need
of call asset.update(); ------------------------------------------------------------------------------------------------
AssetParameters asset;
;
asset =AssetParameters::find(true);
ttsbegin;
asset.AutoNumber=NoYes;
asset.update();
ttscommit


Answer:
AX works with cursors
In code snippet , asset - is a cursor - a special object storing the values of a record of a specific table, in your case, the AssetParameters table. Which means that you can modify any fields in this cursor, but they won't get reflected in the database, because it's NOT the database, it's just a
storage for the values you input. The update method, if properly called (notice the ttsbegin and commit and the true parameter in the find method), will transfer the changes in the
cursor into the database.DAX kernel makes the analysis and extra manipulations with the data when
super() of this method on table level is called.For example, it can set the modifiedBy and other modified* fields on the record, if the corresponding properties are turned on on the table.
Also, it analyzes the fields that have been changed and creates the query,needed for the update, assigns a new RecVersion, validates that no other users have changed the record while you were making your changes (here concurrency models are analyzed as well), etc...

More RecId and Id

A RecId is a unique identifier for any record in:
a table (for DAX 4.0)
the entire company (DAX 3.0 and earlier)

RecId is assigned to every record by the kernel of Dynamics AX each time a
record is created.

an ID is not a standard name in DAX, so it's either a customized field added
into the table you are looking into, or just an identifier of an object.

For example, there is a TABLE ID, which is the number of each table in DAX.
A FIELD ID is an integer identifing a field in a table.

etc.

You can make your IDs string as well, for example the NumberSequences work
this way.

Dynamics AX Certification

Dynamics AX Certification

Microsoft Dynamics AX 4.0 Development
Introduction Certification Exam (VUE Exam # AX 40-508,
Prometric Exam # MB6-508) Preparation Guide


Target Audience
Individuals wishing to obtain a certification on Microsoft Dynamics AX 4.0 Development Introduction should take this exam.

Exam Specifics Skills Being Measured:
This certification exam measures your ability to understand and use the integrated development environment of Microsoft Dynamics AX, MorphX Development Suite. You will be tested in the AX Architecture, Data Dictionary, user interfaces and Report adjustments. You will also be measured in how to use X++, Classes, Control statements, Data Base access and Exception Handling.

Time Requirements and Questions:
90 minutes to complete the exam
75 questions with a passing rate of 70%
Multiple Choice and Multiple Answer questions

Registration:
Register for VUE Exam# AX 40-508 AX 4.0 Development Introduction Certification Exam at
Pearson VUE
Register for Prometric Exam# MB6-508 AX 4.0 Development Introduction Certification Exam
at Thompson Prometric

Exam Preparation Tools
In addition to your hands-on experience working with the product, we highly recommend using the
following tools and training to help you prepare for this exam:
Training Materials:
8623: Development I in Microsoft Dynamics AX 4.0
8633: Development II in Microsoft Dynamics AX 4.0
Instructor-Led Training (Please check with your region to verify instructor-led training
availability):
8623: Development I in Microsoft Dynamics AX 4.0
8633: Development II in Microsoft Dynamics AX 4.0
For training materials in additional languages visit Training Materials and search for additional languages.
For instructor-led training in additional languages please visit Find Training and search for courses in
additional languages.

Additional Skills Recommended:
Experience in object oriented programming

Exam Topics
General Microsoft AX Architecture – 18%
Understanding of 3-tier Architecture
Understanding of AOS
Knowledge of Layer Technology and how to Work with Them
Understanding of Label System and Creating Label Files
Development Tools - 18%
General Knowledge of AOT
How to use Intellimorph
How to Import/Export Objects
Debugging Techniquest
Visio
Application Objects– 21%
Creating Data Dictionary Objects
Creating and Working with Forms
Setting Up Projects
Creating and Working with Reports
Creating and Working with Queries
Creating and Working with Menus and Menu Items
Utilizing the Security Structure
Utilizing the Configuration Structure
Table Collections and Virtual Companies
X++ Development – 27%
Data Manipulation/Accessing the Database
Working with Maps
Interacting with the User
Working with Data Models
Working with Class Models
AX-specific Select Techniquest
Best Practices – 16%
Using Naming Conventions
General X++ Coding Standards
Using Validation Techniques

What is the difference between a RecId and an Id?

1. What is the difference between a RecId and an Id?

Ans. The kernel generates the RecId while the Id is generated by the
application.

Sunday, September 9, 2007

Extended datatype of a variable

Question
how can I determine the extended datatype of a variable dynamically?
I know the function typeof(), but that gives me only the underlying basic-type through the enum Types. That's not enough for my purpose.

Answer:
static void printType(Args _args)
{
DictType dictType;
;

print "This ID is the TypeId, not the EDT ID - ", typeId(ItemId);
print "This ID is what we need - ", typeId2ExtendedTypeId(typeId(ItemId));
print "This ID is wrong - ", new DictType(typeId(ItemId)).id();
dictType = new DictType(typeId2ExtendedTypeId(typeId(ItemId)));
print "This ID is correct - ", dictType.id();
print dictType.name();
pause;
}




dynalink info in caption of forms

Question:
When opening a form with a dynalink to some record, this dynalink information
is automatically added to the form caption, often making the caption very
long and hard to read. Example: Open the SalesTable form from a debtor
record.

Answer 1.
you can add this line befor super() call in init() method of the form.

element.args().record(NULL);

Answer 2.
You can override the active method on the datasource and add the
following line there:

element.design().caption(strfmt("%1", smth));

Saturday, September 8, 2007

Time difference b/w insert_recordset and update_recordset

Prerequisite to run this Job is to create a new table of the name TestTable having a field CustName which extends from CustName EDT.

Here i am trying to find what time is takes to insert and update records using insert_recordset and update_recordset.When the Table's Temporaryproperty is YES and No.

With Temporary property set to No.update takes half of the time it takes to insert.

With Temporary property set to Yes.update and insert operations take zero time.




TestTable test;
CustTable Cust;
int time1;
int time2;
;

time1 = WinAPI::getTickCount();
insert_recordset test(CustName)
select Name from Cust;
time2=WinAPI::getTickCount();
info(strfmt('Insert Time %1 %2',time2,time1));
time1 = WinAPI::getTickCount();
//UPDATE INSERT TAKES HALF OF THE TIME WHAT IS TAKES FOR INSERT.
update_recordset test
setting CustName='Huzaifa';
time2=WinAPI::getTickCount();
info(strfmt('Update Time %1 %2',time2,time1));
while select * from test
{
info(test.CustName);

}