Thursday, May 27, 2010

Troubleshooting RPC communication error in axapta.

I encountered the following error while importing data to Axapta.

"Communication Error
Your Microsoft Dynamics Axapta session is no longer valid.Log off your computer and log on again.if the problem persists,contact your Dynamics Axapta Admin."

I am running both client and server on my system (Win 2k3 RC2 Sp1)
I searched through a couple of forums for the solution and found out that this problem needs a windows 2003 server hot-fix to be installed.The patch/hot-fix is available for download here

Install->Reboot and you are good to go!

Tuesday, December 15, 2009

Sending emails using Microsoft CDOSYS.

After looking around for a while i realized that CDONT's has been deprecated.I am not sure if Microsoft still ships their server OS with CDONT's. These libraries are still available as en external resource that can be accessed either by adding meta tags to your asp application or by creating a CDO configuration object.
Here is a sample code on how you can send emails using Microsoft CDOSYS using a remote server.




<%
dim htmlMess
htmlMess=""
htmlMess=htmlMess & " "
htmlMess=htmlMess & " Sending email using Microsoft CDOSYS"
htmlMess=htmlMess & " "
htmlMess=htmlMess & " "
htmlMess=htmlMess & " &Request("email")"
htmlMess=htmlMess & " "
htmlMess=htmlMess & " "

Set emailMess=CreateObject("CDO.Message")
emailMess.Subject="This is a test email sent using CDOSYS"
emailMess.From="fromemail@yourdomain.com"
emailMess.To="toemail@somedomain.com"
emailMess.Cc="cc@somedomain.com"
emailMess.Bcc="bcc@somedomain.com"
emailMess.AddAttachment "D:\att.rar"
emailMess.HTMLBody=htmlMess
emailMess.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
emailMess.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.yourdomain.com"
'Server port
emailMess.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
emailMess.Configuration.Fields.Update
emailMess.Send
set emailMess=nothing

%>



Another fact that i would like to mention is that,you necessarily don't have to write code for sending email as your hosting provider is supposed to take care of sending emails.Do talk to your hosting provider about email component as they are supposed to provide you with this facility.