axapta

X++ passing current selected records in a form for your report

无人久伴 提交于 2019-12-05 10:38:43
I am trying to make this question sound as clear as possible. Basically, I have created a report, and it now exists as a menuitem button so that the report can run off the form. What I would like to do, is be able to multi-select records, then when I click on my button to run my report, the current selected records are passed into the dialog form (filter screen) that appears. I have tried to do this using the same methods as with the SaleLinesEdit form, but had no success. If anyone could point me in the right direction I would greatly appreciate it. Take a look at Axaptapedia passing values

Reading a comma separated values (csv) file in dynamics ax

穿精又带淫゛_ 提交于 2019-12-05 05:59:34
How do you open and parse a csv file in dynamics ax? static void TestCommaTextIO(Args _args) { #File CommaTextIo commaTextIo; FileIOPermission permission; container containFromRead; int x; int cols; ; permission = new FileIOPermission('c:\\junk\\mycsv.csv',#io_read); permission.assert(); commaTextIo = new CommaTextIO('c:\\junk\\mycsv.csv','R'); containFromRead = commaTextIo.read(); While(containFromRead) { cols = conLen(containFromRead); for(x=1;x<=cols;x++) { print conpeek(containFromRead,x); } containFromRead = commaTextIo.read(); } pause; commaTextIo = null; } 来源: https://stackoverflow.com

How to change the level of AX info messages

纵饮孤独 提交于 2019-12-05 02:15:50
In Dynamics AX 2009 I am trying to determine the level of indentation of an info message. What I want is something similar to this: Prefix Info1 Info2 Prefix2 Info3 I found this: http://www.doens.be/2010/05/the-ax-infolog/ But don't want to use a loop, so I thought something like this might work: setprefix("Prefix"); { info("Info1"); info("Info2"); } setprefix("Prefix2"); { info("Info3"); } But it doesn't. Is there a way to do this in x++, and what are the rules as to what indent level is currently active? setPrefix in AX sets (adds) the prefix for the current execution scope, and when leaving

How do you find a user's last used printer in SysLastValue

戏子无情 提交于 2019-12-04 18:20:00
I've been trying to find where a user's last used printer is stored so that I can clear this usage data (as a few users have an issue where the remembered printer keeps defaulting to the XPS writer, despite us having KB981681 installed & the printer being available; just not defaulted on certain AX forms). I know this data's somewhere in the Usage Data, which I can browse via AX: Microsoft Dynamics AX > Tools > Development Tools > Application Objects > Usage Data AOT > System Documentation > Tables > SysLastValue > (right click) > Add-Ins > Table Browser Or through SQL: use AXDB go select *

How to do unit testing in Microsoft Dynamics AX 2012 in a real world project

半世苍凉 提交于 2019-12-04 13:54:18
问题 Dynamics AX 2012 comes with unit testing support. To have meaningful tests some test data needs to be provided (stored in tables in the database). To get a reproducable outcome of the unit tests we need to have the same data stored in the tables every time the tests are run. Now the question is, how can we accomplish this? I learned that there is the possibility of setting the isolation level for the TestSuite to SysTestSuiteCompanyIsolateClass . This will create an empty company and delete

How to create a lookup with fields from more than one datasource?

谁说胖子不能爱 提交于 2019-12-04 11:56:08
I need to create Dynamic lookup in my form field which should display fields from two different datasources.. I am trying to perform it as: public void lookup() { query = new Query(); sysTableLookup = SysTableLookup::newParameters(tableNum(smmBusRelTable), this); qbds = query.addDataSource(tablenum(smmBusRelTable)); // qbds.addDataSource(tableNum(DirPartyTable)); //qbds.relations(true); sysTableLookup.parmQuery(query); sysTableLookup.addLookupField(fieldNum(smmBusRelTable, Busrelaccount)); //sysTableLookup.addLookupfield(fieldNum(DirPartyTable, Name)); sysTableLookup.performFormLookup(); }

Try to use Winapi::findFirstFile running on server

天大地大妈咪最大 提交于 2019-12-04 08:44:40
I have a problem trying to run Winapi::findFirstFile running on server. I havve already tried copying the method on the class WinapiServer, and changing some lines, like this: server static container findFirstFile(str filename) { InteropPermission interopPerm; Binary data; DLL _winApiDLL; DLLFunction _findFirstFile; ; interopPerm = new InteropPermission(InteropKind::DllInterop); interopPerm.assert(); data = new Binary(592); // size of WIN32_FIND_DATA when sizeof(TCHAR)==2 _winApiDLL = new DLL(#KernelDLL); _findFirstFile = new DLLFunction(_winApiDLL, 'FindFirstFileW'); _findFirstFile.returns

Table Update Event Handler

给你一囗甜甜゛ 提交于 2019-12-04 07:48:46
I am investigating the capabilities of the new delegate & event subscription pattern in AX 2012. At the moment I am looking to detect when a particular field has been modified, for example when SalesTable.SalesStatus is changed to SalesStatus::Invoiced . I have created the following post-event handler and attatched to the SalesTable.Update method; public static void SalesTable_UpdatePosteventHandler(XppPrePostArgs _args) { Info("Sales Update Event Handler"); } Now I know I can get the SalesTable from the _args , but how can I detect a field has changed? I could really use a before & after

Execute .exe in SSRS Report

对着背影说爱祢 提交于 2019-12-03 22:45:54
i want to execute a .exe in a SSRS Report from Microsoft Dynamics AX . I tried so far to realize that over Custom Code and a Textfield with following Expression: =Code.StartProcess("test") Public Function StartProcess(ByVal s As String) As String Dim pHelp As New ProcessStartInfo pHelp.FileName = "test.bat" pHelp.Arguments = s pHelp.UseShellExecute = True pHelp.WindowStyle = ProcessWindowStyle.Normal Dim proc As Process = Process.Start(pHelp) Return "it works" End Function I get the error ":StartProcess is invalid. InvalidIdentifier" As second try i use this: ="javascript:void(window.open(

Nested notExists joins X++ (Dynamics AX3.0)

馋奶兔 提交于 2019-12-03 22:11:45
When the following code executes: select sum(qty) from inventTrans index hint TransTypeIdx where inventTrans.ItemId == itemId && inventTrans.TransType == InventTransType::Sales && inventTrans.InventDimId == inventDimId notExists join custTable where custTable.AccountNum == inventTrans.CustVendAC && custTable.CustGroup == custGroupId notExists join salesTable where salesTable.SalesId == inventTrans.TransRefId && salesTable.Extraordinary == NoYes::Yes; The sql generated nests the second notExists join (salesTable) into the where clause of the first notExists join (custTable). ie SELECT SUM(A.QTY