Skip to main content

Posts

Showing posts from October, 2012

code to send email from ax with attachment in MSDAX

This is the code to send email from axapta with attachment.You can write this code in method of any class and simple call it. InteropPermission IntCPermission = new InteropPermission(InteropKind::ComInterop); InteropPermission IntCPermission1 = new InteropPermission(InteropKind::ClrInterop); InteropPermission IntCPermission2 = new InteropPermission(InteropKind::DllInterop); str body,mailto, mailfrom; System.Net.Mail.AttachmentCollection attachementCollection; str FileName; FileIOPermission FilePerm; SysMailer mailer; SysEmailParameters parameters = SysEmailParameters::find(); ; try { IntCPermission.assert(); mailer = new SysMailer(); if (parameters.SMTPRelayServerName) { mailer.SMTPRelayServer(parameters.SMTPRelayServerName, parameters.SMTPPortNumber, parameters.SMTPUserName, SysEmailParameters::password(), parameters.NTLM); } else { mailer.SMTPRelayServer(parameters.SMTPServerIPAddress,...

The process of cancel workflow in MSD axapta

compelling point before you install Microsoft Dynamics Axapta EP

here compelling point before you install Microsoft Dynamics AX EP: 1: Pre requisite 2:Configuration 3:Deployment(from the AOT to the web server/SharePoint server) 4:Site Creation  (1) Pre requisite: #1 WSS(Windows SharePoint Services) 3.0 or MOSS(Microsoft Office SharePoint services) 2007 SP1  IIS 6/7  .Net 3.5/ SP1  ASP.net 3.5 #2  SQLAMQ(SQL Analysis Object Management)           To connect to the back end services         #3  ADOMD.NET      .net BC must be installed  Note: X++ classes must be complied with .NET BC and Checklist must be completed

Exception Chart in MSD axapta

This is Exception Chart in Microsoft dynamics Axapta. Exception handling should start with try block and exception can be cache able  in catch section. Read below instruction to get more details. Exceptions are errors that may occur during the execution of a program. Keep in mind the following facts about exceptions: When an error occurs, an exception is thrown. When a system error occurs, an exception is thrown by the operating system. You can write code to throw custom exceptions. Handling an exception means dealing with the exception in an appropriate manner. Exception handling should not be used for normal program flow control. Exceptions are handled by enclosing your code in a try block and then using catch statements to handle exceptions that might be thrown.

Close MSD Axapta client or Instance by code in job

Close Axapta client or Instance by code in job. Info is class you can declare object of info class. Info class include shutdown method if you pass true parameter than it will close instance of axapta. SysGlobalCache SysGlobalCache1 = appl.globalCache(); info info; ; SysGlobalCache1.set(classstr(info), identifierstr(Autologoff), true); info = new info(); info.shutDown(true); Or you can set value in shutdown in user option form . You can also write following line to close axapta. Infolog.shutdown(true); It will close axapta forcefully.

Use Index Hint with query in MSD axapta

To use Index Hint with query in axapta you can refer following example where abcIdx is Index name in TestTable. Index hint help to improve performance of query. TestTable Test_New; select Count(ProductionId) from Test_New index hint abcIdx group by Test_New.Id where Test_New.Id == '123' && Test_New.tId == 'was1' && Test_New.TransDate >= str2date("01-Jul-2012",123) && Test_New.TransDate <= str2date("16-Jul-2012",123) && ;