Tuesday, December 23, 2008

Axapta view of view may cause wrong results

When create view in Axapta, an existing view should not be used as data source because it may produce wrong result.
This happen when the originating view has more than one data source in it.
When view is created, Axapta uses the following technique :
- Use the first data source's dataareaid field as the view dataareaid field
- Use the second data source's dataareaid field as the view dataareaid#2 field
When used as a whole, this view will only show the first dataareaid as its dataareaid. Axapta kernel will filter based on dataareaid and dataareaid#2 with the correct company account. This case no problem.

Problem occurs when the view is used in another view, with additonal datasource attached to it.
Using the same rule as above, the new view's dataareaid#2 field will be replaced by the new datasource attached to it, so the original view second data source is no longer filtered by dataareaid. This may lead to a duplicate data when the same data of the original view's second data source exists in more than one company.

Tuesday, September 23, 2008

Delete duplicate rows

Recently I need to build an Axapta instance where the application has been modified while I only have a standard demo database.
Problem arises as the modified application has new indexes or change the table properties 'SaveDataPerCompany' to No instead of default Yes. Both may cause duplicate record problem. I don't want to just delete the entire record yet I need to synchronize the table with Axapta application.

It will be no problem if the table contains less than 20 records, I can just delete it manually. The problem is that I find a table has hundreds of records. Then I write this script to do this job less tedious.

--drop table #mytemptable -- This is needed only if run more than once
select distinct
module,type,groupid --specify as many as key fields
into #mytemptable
from pricediscgroup --this is the table name

--set variable s correspond to the key fields
declare @module int
declare @type int
declare @groupid varchar(20)
declare @numberofrows int
declare mycursor Cursor for
SELECT * from #mytemptable
open mycursor

fetch next from mycursor into @module,@type,@groupid

while @@fetch_status=0
begin

select @numberofrows = count(*) from pricediscgroup where
module = @module and type= @type and groupid = @groupid
select @numberofrows, @module,@type,@groupid
if @numberofrows > 1
begin
set @numberofrows = @numberofrows - 1 -- leave one row

set rowcount @numberofrows --the select within the subquery will return this number of rows,
delete from pricediscgroup where recid in (
select recid from pricediscgroup p2
where
p2.module = @module and p2.type= @type and p2.groupid = @groupid)

end

fetch next from mycursor into @module,@type,@groupid
end

close mycursor

deallocate mycursor

It does take time to change the table name and adding some variables depend on the duplicate fields found. But it takes less time rather than deleting many rows manually.

Thursday, September 11, 2008

Role centers and enterprise portal on Ax 2009

During installation of role centers and enterprise portal I got this error:

Setup cannot connect to the Application Object Server instance (AOS) by using the Business Connector. Confirm that the AOS is running, and that your account (domain\username) is a valid Microsoft Dynamics AX user. See the log file C:\Documents and Settings\All Users\Application Data\Microsoft\Dynamics AX\Dynamics AX Setup Logs\2008-09-11 11-27-45\DynamicsSetupLog.txt for more information.

I have checked that the user already exists in Axapta. Then I tried changed the service account with the same user and it works.
The service account is in Administration > Setup > Security > System service account. Put the username and domain in the alias and network domain fields.

I post this with hope to save time just in case others get the same problem.

Wednesday, August 27, 2008

Referenced account is currently locked out

Recently I experienced a problem accessing a network share. Each time I go to start > run > \\networkshare I always get this error message :
\\networshare is not accessible. You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permissions.
The referenced account is currently locked out and may not be logged on to.

I have checked with the administrator and unlock my AD account but the error persist.
Seems that there is a cache on my user profile accessing the network share using wrong password.
The solution is then I force using this in command prompt :
net use \\networkshare\ipc$ /user:domain\user

Then it asks for password and later I can access the networkshare again.

Friday, July 11, 2008

Trace Parser for Dynamic Ax

I am about to install Trace Parser to see how it can help solving performance issue. This tool can be downloaded here

Friday, July 4, 2008

Axapta : unable to load page error

Recently I got an error "unable to load page" when opening report. After googling I found this . The solution is to use newer client kernel.
However weird that I don't experience the problem using diferent pc as client, using old kernel.

Thursday, June 26, 2008

Sharepoint service log files grow rapidly

Recently I noticed that I run out disk space in my virtual machine where I install Windows sharepoint services.
I see that the log folder grows very big in size. It is already 2 GB now.
The default log folder is located here :
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\LOGS\
To avoid it consumes space in C, I change it to different folder which is achieved through:
Sharepoint central administration > Operations > Diagnostic logging.
Then I also change timer job definitions by disabling them (maybe I will enable them once I know more about sharepoint).

Wednesday, June 18, 2008

Installing Dynamic Ax 2009

After some years working with Axapta 3 and 4, today I tried installing Dynamic Ax 2009.
The first impression with Ax 2009 is that the software contains more options than Ax 4, and the installation guide is more detail.

I download the installer here and the demo data
here. Seems weird because usually all are packed into one installation source (DVD).
Note that partner source login is required to download.

I run the installer and create a new blank database. After installation checklist finished, I restored the demo data (which comes as database backup) and point the AOS to the demo data instead of blank database created during installation.
When I started the AOS service I got this error in the event viewer :

The version of the stored procedures in this database is different than that expected by the Application Object Server (AOS). You must set up a new instance of the AOS that points to this database to update the version of the stored procedures


Seems that the demo data is created using AOS of earlier version from the latest download. Looking at the SQL Server profiler, I found that the table SQLSYSTEMVARIABLES is accessed during service start. Comparing two databases (one created during installation and one from demo data), contents of this table are different, and the one from installer is newer.
So I run this statement into the demo data database :

delete from sqlsystemvariables;
insert into sqlsystemvariables select * from DynamicAx5Blank.dbo.sqlsystemvariables;

Then restart AOS and it works.

Tuesday, May 6, 2008

The backup set holds a backup of a database other than the existing database

This error message appear when I tried to restore an SQL 2K SP4 db into SQL 2005, using SQL Server Management Studio.
Although I have specified overwrite existing database, the error message still appear.
So I run transact-sql statement instead :

restore filelistonly
from disk = 'D:\SQL Backup\sourceDB.bak'
GO

--This will show the logical file name needed in the operation below
restore database targetDB
from disk = 'D:\SQL Backup\sourceDB.bak'
WITH MOVE 'sourceDB_Data' TO 'D:\SQLDATA\targetDB_Data.MDF',
MOVE 'sourceDB_Log' TO 'D:\SQLDATA\targetDB_Log.ldf',
REPLACE,STATS
GO

-- The option with replace is mandatory as it will overwrite existing database. With stat will show the operation progress

Wednesday, April 23, 2008

Check my computer 32 or 64 bit

Go to Start > Run and type in msinfo32 then hit OK.

On the window that comes up, look at Processor. If it says x86 (something) then it's a 32 bit processor. Otherwise, it's 64.

Taken from Experts Exchange

Also this link shows various ways to find 64 bit cabability in various OS.

Tuesday, February 5, 2008

Using filter on SQL Server 2005 profiler

When I first used SQL Server 2005 Profiler to trace the actual sql statement generated from Axapta, I was wonder where I could filter the result based on database name as it is in SQL Server 2000.

This question is answered easily. There is a tick box 'show all columns' in the event selection tab. After this selected, then there are more columns available on the button Columns Filters.



Monday, January 28, 2008

WSS Glossary

Recently, I work on learning another Microsoft product called Windows Sharepoint Services 3.0.
One difficulty is that there are many new terms that I need to understand.
Below I list some of the terms that I think I need to understand the clear definition. I will add when new term is found.
Site A group of related Web pages in Windows SharePoint Services where users can share data in lists and libraries, and can view and edit one or more Web part pages. Sites are generally used for collaboration, but can also be used to host content.
Site collection A set of Web sites that have the same owner and share administration settings. Each site collection contains a top-level Web site and can contain one or more subsites.
Site definition A directory on the front-end Web server containing the .xml files and .aspx page templates that define a blueprint for the site.
Site template A file that includes a set of .xml files that contain the manifests and configuration parameters that modify a site definition.
Site template gallery A collection of site templates.
Web part A modular unit of information that consists of a title bar, a frame, and content. Web parts are the basic building blocks of a Web part page.
Web part page A Web page that can host one or more Web parts. A Web part page usually contains one or more zones to allow Web parts to be manipulated on the page.

Friday, January 11, 2008

Windows 2003 server : mencegah file terblock

Baru-baru ini saya mengalami masalah dengan file yang dicopy dari suatu ftp site ke server Windows 2003 SP2 saya.
Seluruh file dengan extension .zip terblock oleh Windows.
Setelah googling, akhirnya saya temukan di sini bahwa penyebabnya adalah Internet Explorer Enhanced Security Configuration aktif. Ini menyebabkan security setting di Internet zone diset ke High, yang salah satu efeknya menyebabkan file2 yang di ambil dari Internet zone menjadi terblokir.
Untuk mengatasinya saya buka Internet Explorer > Tools > Option > Security tab.
Pilih Internet zone, lalu klik Custom level.
Setelah itu cari "Launching of application and unsafe files" ubah pilihan dari disable menjadi enable.
Ini membuat security setting yang tadinya High menjadi custom.
Setelah selesai menggunakan file yang tadinya terblock, saya kembalikan security setting Internet zone ke High.
Pemahaman lebih lengkap soal security setting di Internet Explorer ada di sini