Greetings! Welcome to my Dynamics AX 7 and related MS Technologies blog.
Total Pageviews
Search This Blog
Thursday, January 31, 2008
Wednesday, January 30, 2008
Structuring the first installer
Let’s start by following these steps:
a. Writing a simple .wxs xml installer source code .
b. Compiling the source code
c. Building the MSI.
OCC Contd...Concurrency Model configuration
Use the READ UNCOMMITTED transaction isolation level for all Microsoft SQL Server 2000 database reads - Can be used to reduce blocking for installations running on Microsoft SQL Server 2000 databases.
Wix Introduction and Features
WiX (Windows Installer XML) is a toolset that builds Windows Installation Packages from XML Source Code. It provides a command-line environment that developers may integrate into their build processes to build MSI (Microsoft Installer) packages. WiX is an open source project. This toolset is written in C#.
Pre-Requisites
.NET Framework (Required on Developer’s system).
WiX Binaries and SDK(Required on Developer’s system).
Note: The installation packages built with this toolset do not require any software to be installed on the target computer.
Features
Features and advantages of the toolset:
· Declarative approach
· Unrestricted access to Windows Installer functionality
· Source code instead of GUI-based assembly of information
· Complete integration into application build processes
· Possible integration with application development
· Support for team development, both in-house and third-party
· Free, open source
Dynamic Property on Query's DataSource Fields
2. For e.g. AssetBudgetModel\DataSources\Assetbudget\fields click the data source right-click Fields, and then click Properties.
2. Set the Dynamic property to No.
Note
By default, the Dynamic property is set to Yes and returns all fields from the table, map, or view. This makes maintenance easier because you don't need to change the query if a field is changed in the underlying data source. However, restricting the fields returned by the query is better for performance because unused data is not returned to the client each time the query is run.
Tuesday, January 29, 2008
How to invoke .NET Assembly from SQL Server 2005
1. Write a C# assembly which will have a simple method called "HelloWorld" which will take a string as argument and will return the string concatenated with "Hello".
2. Build the assembly
3. Open SQL Query Analyzer and
CREATE ASSEMBLY asmHelloWorldSQL FROM 'c:\HelloWorldSQLAssembly.dll'
Note: asmHelloWorldSQL is name of assembly which can be anything and we have to pass the path where the assembly resides
4. Create a function which will reference the assembly we created
CREATE FUNCTION dbo.clrHelloWorld
(
@name as nvarchar(200)
)
RETURNS nvarchar(200)
AS EXTERNAL NAME [asmHelloWorldSQL].[HelloWorldSQLAssembly.Class1].[HelloWorld]
Note: This function will invoke the HelloWorld method from the assembly and return the string.
5. SELECT dbo.clrHelloWorld('Invoke from SQL 2005')
and,
this will return
"Hello Invoke from SQL 2005"
Happy assembling :-)
Configure CLR option in SQL Server
Error:
/**
Msg 6263, Level 16, State 1, Line 1
Execution of user code in the .NET Framework is disabled. Enable "clr enabled" configuration option.
**/
Solution:
EXEC sp_configure 'clr enabled', 1
RECONFIGURE WITH OVERRIDE
GO
Tools - Addins - Source Code TitleCase Update
e.g. Go to AOT->
Once it is run, it will list an infolog with the changes which are done to the code.
X++ code to find unique index/primary keys for any table
Friday, January 25, 2008
Complex query expressions
In init() method of Custtable datasource, put the following code:
CustTable_ds.query().dataSourceNo(1).addRange(fieldnum(Custtable,custgroup)).value(strFmt('((CustGroup=="%1") (Currency=="%2"))',queryvalue("50"),queryvalue("EUR")));
In the value part, we can have OR expression i.e. ((CustGroup=="%1") (Currency=="%2"))
and then the actual values supplied at the end.
Wednesday, January 23, 2008
Will Microsoft build a mega-suite for its ERP product??
http://www.daxnews.net/index.php?option=com_content&task=view&id=86&Itemid=1
http://rcpmag.com/blogs/weblog.aspx?blog=1478
Tuesday, January 22, 2008
Dynamics Axapta and OCC (Optimistic Concurreny Control)
Definition
Optimistic Concurrency Control (OCC) helps increase database performance. Pessimistic Concurrency Control locks records as soon as they are fetched from the database for an update. However, Optimistic Concurrency only locks records from the time when the actual update is performed.
Pessimistic concurrency was the only option available in Microsoft Axapta 3.0 (now a part of Microsoft Dynamics). You can now choose which concurrency model to use—optimistic or pessimistic.
Advantages
- Fewer resources are used to hold the locks during the update process.
- Records are locked for a shorter length of time.
- Records remain available for other processes to update if they have been selected from the database but haven't yet been updated.
Disadvantages
The disadvantage of using OCC is that the update can fail if another process updates the same record. If the update fails, it must be retried. This can lead to a reduction in database performance.
How to catch Update Conflicts
Update Conflicts can be handled by catching the UpdateConflict and UpdateConflictNotRecovered events.
This pattern is used across AX API's for retrying the update conflicts and if it exceeds the maximum retry count then UpdateConflictNotRecovered exception is thrown.
e.g. AOT\Classes\PurchTableType\delete
Update Conflicts and recversion field
Update conflicts are detected by the kernel. It checks the value of the recVersion system field on the table at the time the record is selected for update. This value is matched to the value of the field when the record is subsequently updated. The default value of recVersion is 1. This is changed to a random value when a record is updated.
Links
http://msdn2.microsoft.com/en-us/library/ms378709.aspx
http://msdn2.microsoft.com/en-us/library/bb190073.aspx
Dynamics AX 4.0 Enterprise portal website
Site: www.itvertigo.com
See the thread below for more details:
http://groups.google.com/group/microsoft.public.axapta.programming/browse_thread/thread/127b0f7b7f68163f/27e9c34befeb1ba3#27e9c34befeb1ba3
Monday, January 21, 2008
Wednesday, January 16, 2008
Dynamics AX WebCasts
Microsoft Dynamics AX Technology WebCasts
Wednesday, January 9, 2008
Friday, January 4, 2008
AX Strange Errors
Object Server 01: Dialog issued for client-less session 1: Error executing code: SysCheckList_Setup object does not have method 'isSetupMode'.
Stack trace
(S)\Classes\SysCheckList_Setup\isSetupMode
(S)\Classes\Application\isRunningMode - line 5
(S)\Classes\Application\dbSynchronize - line 12
(S)\Classes\Application\syncApplTables - line 5
(S)\Classes\Application\new - line 6
Object Server 01: Dialog issued for client-less session 1: Error executing code: object does not have method 'main'.
Stack trace
(S)\Classes\\main
Object Server 01: I/O Error 38 (OS error ) occured when session 3 accessed E:\Program Files\Microsoft Dynamics AX\40\Application\appl\standard\axapd.aoi. User chose to retry.
Solution:
Stopped AOS Service
Deleted axapd.aoi file in application folder
Restart AOS Service
Start AX