Update in Axapta Thursday, Dec 11 2008 

I’ve learned axapta for 2 days and I found a wall while customized it :p
Actually, it’s really different with Solomon, you could not just select or update like sql script. Here’re the scripts:

ttsbegin;
while select forUpdate wmsorder where wmsorder.inventTransId == salesline.InventTransId
{
select * from inventtable where inventtable.ItemId == salesline.ItemId;

if (inventtable)
{
wmsorder.itemName = inventtable.itemName;
}
wmsorder.PortDest = salestable.Port;
wmsorder.doUpdate();
}
ttscommit;

ttsbegin and ttscommit are like tranbeg and tranend in Solomon. This code makes sure your table is in update condition, and the system will wait until your update process finish.

Redim Preserve di C# Tuesday, Oct 14 2008 

Karena sempat merasa bosan dengan coding di VB, last few days saya coba” coding di C# :) dan ternyata jauh lebih bebas coding di C# ketimbang di VB. But, sempet bingung dengan how to define redim preserve in c#, and finally I did it. Below is the example code.

string[] MyArray;
string[] temp;

for (i=0;i<length;i++)
{
temp = new string[i + 1];
if (MyArray != null)
    Array.Copy(MyArray, temp, Math.Min(MyArray.Length, temp.Length));
MyArray = temp;
}

How to define day name in SQL Server Thursday, Sep 4 2008 

The SQL function that you could use is datename(datepart, date). Datepart is kind of properties that you’d like to use. For example, dw is kind of datepart to define week day, or mm to define month name. Here is the example

select datename(dw, getdate())

The result is

Thursday

You could try others datepart such as dw, mm, dy, wk, ww. Have a nice try :)

Shortcut to faster login (SL 7.0 SP1) Wednesday, Sep 3 2008 

There’s a weakness of SL 7.0 SP1 when I’d like to login while I used the different server as current in the last login. Let’s say I’m using ‘SL7Server’ as server name for the first time, and then I’m going back home and would like to continue my work, which is my local server name is different with the latest server name I’ve used. There’s a problem with time when I’d like to login. It really takes time when SL trace the latest server name as default. I’ve ever waited it for 20 minutes and there was nothing.

The shortcut way to make it faster is deleting the solomon.ini file in C:\Documents and Settings\[my windows login name]\Local Settings\Application Data\Microsoft Dynamics SL.  I’ve tried it and it worked :) , SL will create a new solomon.ini file after the re-login.

Send Mail SQL Server 2005 Tuesday, Aug 26 2008 

SQL 2005 has easier step to send email than SQL 2000 (of course), and hopefully so is SQL 2008. You only need to run the scripts under your msdb database (For example). Please take a look below scripts.

DECLARE @ProfileName VARCHAR(255)
DECLARE @AccountName VARCHAR(255)
DECLARE @SMTPAddress VARCHAR(255)
DECLARE @EmailAddress VARCHAR(128)
DECLARE @DisplayUser VARCHAR(128)

SET @ProfileName = ‘MyMail’;
SET @AccountName = ‘MyMailAccount’;
SET @SMTPAddress = ’smtp.mySMTPServer.com’;
SET @EmailAddress = ‘username@myMail.com’;
SET @DisplayUser = ‘The Mail Man’;

EXECUTE msdb.dbo.sysmail_add_account_sp
@account_name = @AccountName,
@email_address = @EmailAddress,
@display_name = @DisplayUser,
@mailserver_name = @SMTPAddress

EXECUTE msdb.dbo.sysmail_add_profile_sp
@profile_name = @ProfileName

EXECUTE msdb.dbo.sysmail_add_profileaccount_sp
@profile_name = @ProfileName,@account_name = @AccountName,
@sequence_number = 1

After above scripts run well, you could send the email by writing below scripts.

EXEC msdb.dbo.sp_send_dbmail
@recipients=’recipients@myMail.com’,
@body= ‘BODY PERFECT, SEEMS GOOD’,
@subject = ‘My Man’,
@profile_name = ‘MyMail’

If it’s working properly, there will be a message Mail Queued. You also could see the sent status by selecting from tables sysmail_allitems in msdb database.

select sent_status, * msdb.dbo.sysmail_allitems

Have a nice try :)

Happy Day Tuesday, Jul 29 2008 

Dan kubertanya..
Maukah kau terima..
Pinangan tanpaa..Sisa cinta yang lain

Rona bahagiaa, terpancar, dari anggukaan …
Saat kupasangkan..
Pasang cincin, di jemmarii…



Trima kasih kau terima..
pertunangan indah ini..
bahagia, meski mungkin, tak sebebas merpati..

« Previous PageNext Page »