Skip to main content

Posts

Showing posts from February, 2012

How to connect to a website from MSD Axapta and Writing a web page information

How to connect to a website from Axapta and Writing a web page information str pg; str NameofFile; commaIO yourfile; int Object1; WinInet wi = new WinInet(); ; NameofFile = "C:\\test1.txt"; yourfile = new commaIO(NameofFile,"w"); Object1 = wi.internetOpenUrl('http://daynamicsaxaptatutorials.blogspot.in/'); if (Object1) { pg = wi.internetReadFile(Object1); yourfile.write(pg); } wi.internetCloseObject1(Object1); }

Connecting to External Database From MSD Axapta by x++ code

   Connecting to External Database From Axapta by x++ code.Following code works fine. I tried it. CCADOConnection connection; CCADOCommand Cmd; CCADORecordSet RS; CCADOFields fields; Com Coms; Str Sql; Str Provider = "testServer"; Str DataBase = "Testdb"; Str UserId = "abc"; Str PWD = "xyz"; Str ConnStr = strfmt("Provider=SqlOledb;server=" + Provider + ";trusted_Connection=false;" + "Initial catalog=" + DataBase + ";user id=" + userid + ";password='" + PWD + "';"); ; Sql = "Select * from InventTable where itemid="10001""; connection = new CCADOConnection(); connection.open(ConnStr); Cmd = new CCADOCommand(); Cmd.activeConnection(connection); Cmd.commandText(sql); RS = new CCADORecordSet

Calling Sql Stored procedure through MSD axapta code

  Calling Sql Stored procedure through axapta code LogInProperty LogProp = new LogInProperty(); OdbcConnection Con1; Statement stmt1; ResultSet rs; ; LogProp.setServer("SeverName"); LogProp.setDatabase("DataBaseName"); LogProp.setUsername("sa"); LogProp.setPassword("123"); try { Con1 = new OdbcConnection(LogProp); } catch { info("Check username/password."); return; } stmt1 = Con1.createStatement(); rs = stmt1.executeQuery('EXEC [testSTRsp]'); while (rs.next()) { info(rs.getString(1)); }     

Hints for Workflow development for new modules in MSD axapta

Hints for Workflow development for new modules in axapta creating workflows require creating / modifying following workflow artifacts: Workflow Categories  Workflow Templates Workflow Documents Tasks Approvals Workflow Categories To create new workflow categories follow the procedure below: 1. Open AOT 2. Expand the Workflow node 3. Right-click on the Workflow Category node and select New Workflow Category. 4. A new workflow category called WorkflowCategory1 will be created. 5. Right-click on the newly created workflow category and select Properties and set required properties. Property Description Name A unique name for the category Label A meaningful label for the category Ex: Purchase order Help Text Description about the category Module The module to which the category is applicable Workflow Templates Follow the procedure below to create a new workflow template: 1. Open the AOT 2. Expand the Workflow node 3. Right-click on the Workflow Templates node

Set date range to datasource in report fetch method in Microsoft Dynamics Ax

Set date range to datasource in report fetch method using Dynamics Ax querybuildrange  qbr; QueryRun qr = new queryrun(this.query()); ; qbr = qr.query().datasourcetable(tablenum(Inventtrans)).addrange(fieldnum(Inventtrans,DatePhysical)); qbr.value(queryrange(From_Date,To_Date)); element.send(Inventtrans); element.send(Test_1);

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.