Skip to main content

Posts

How to send message alert to Online users in MSD Axapta

Create following job in AOT to send message alert to Online users in Axapta static void sendMsgToOnlineUsers(Args _args) { Eventmsgbox msgbox; EventmsgboxId msgboxId; SysClientclientsessions1 clientsessions1; ; while select clientsessions1 where clientsessions1.Status == clientsessions1tate::Running { msgboxId = Eventmsgbox::nextEventId(); msgbox.initValue(); msgbox.ShowPopup = NoYes::Yes; msgbox.Subject = "Message aler"; msgbox.Message = "Message testing from ax application"; msgbox.SendEmail = false; msgbox.UserId = clientsessions1.userId; msgbox.msgboxId = msgboxId; msgbox.AlertCreatedDateTime = DateTimeUtil::getSystemDateTime(); msgbox.insert(); } }

validation for do not post the invoice without packing slip in MSD axapta

Validation for do not post the invoice without packing slip Below mentioned trick How to configure a AR parameter setting? so no body can not post the invoice without packing slip? mean they must create the packing slip and then system allow them to post the invoice? You will have to setup the Inventory Model Group for the particular item. Inventory management > Setup > Inventory > Inventory model groups In the Setup tab under Physical update group, check 'Receiving requirements' checkbox.

How to call job to another job in MSD axapta using x++ code

How to call job to another job in axapta using x++ code 1. Create simple job job_test  and add it to action menu item in AOT. 2. Call job_test in other job using following code.    Args                    args;     ;         args = new Args();     args.name(identifierStr(Jobs_Test));     new menuFunction(menuItemActionStr(Jobs_Test), MenuItemType::Action).run(args); If you want to add job in action menuitem then just right click on aot menuitem on action type then create new menuitem. After that you can set that job in object selection property of menuitem.  You can not direction drag job to action menuitem.

Simple Example of using tables in Query in MSD axapta Reprts

Simple Example of using tables in Query in axapta Reprts     Query q;     QueryRun qr;     QueryBuildDatasource qbds;     QueryBuildRange qbr;    InventTable inventtab;     ;     q = new Query();     qbds = q.addDataSource(tablenum(InventTable));     qbr = qbds.addRange(fieldNum(InventTable,Status));     qbr.value(queryValue(NoYes::No));     qr = new SysQueryRun(q);     while(qr.next())     {     inventtab = qr.get(tableNum(InventTable));     info(inventtab.Itemid);     }

Code to send email with attachment using dynamics MSD axapta x++

Code to send email with attachment using dynamics axapta x++ void SendEMail() {     System.Net.Mail.MailMessage              Message;     System.Net.Mail.Attachment              attachment;     System.Net.Mail.AttachmentCollection    attachementCollection;     System.Net.Mail.SmtpClient              smtpClient;     System.Net.Mail.MailAddress             emailfrom;     System.Net.Mail.MailAddress             emailto;     str                                     messageBody ;     str                                     Subject;     str                                     SMTPServer;     str                                     Filenm;     FileIOPermission                        permission1;     ;     emailfrom = new System.Net.Mail.MailAddress(" From@xyz.com ","");     mailAddressTo = new System.Net.Mail.MailAddress(" To@abc.com ","");     messageBody = "This is test mail";     Subject = "Subject";     SMTPS