x++

dynamics ax : Push Customized form to All users

空扰寡人 提交于 2019-12-06 19:31:31
Recently, I was troubleshooting an issue related to user settings. There was a requirement to migrate the user settings from one environment to another. There is an AX 2009 form which users make their own personalisations to, moving some of the fields around, or perhaps adding other fields (via the right click->setup functions) , so that unnecessary fields are hidden. I have saved that form , so that it is available for me , but when i migrate the form to another environment i notice that the new user don't have any change on the form. As we all know, User related setups for queries, forms,

How to get a Common object from a table id?

送分小仙女□ 提交于 2019-12-06 15:55:56
How to instantiate a common type object (the table's base class in AX) via a TableId ? Furthermore what else can we do with TableId? My goal is to send tableid to my method and there, I will make the buffer of the table the id belongs to. Is it possible? It can be done like this: public static Common makeRecord(TableId _tableId) { return new DictTable(_tableId).makeRecord(); } maqk Yes you can do this. Here is a webpage explaining: http://www.doens.be/2009/07/select-a-record-from-a-table-when-you-only-have-the-tableid/ 来源: https://stackoverflow.com/questions/10095415/how-to-get-a-common-object

Make order by with Query in AOT

自闭症网瘾萝莉.ら 提交于 2019-12-06 11:13:07
I have made a query in AOT. My goal is to print information using Group by "CustGroup" and Order by "count(RecId)" desc of CustTable table. The group by works properly, but the order by does not. I can not understand why... This is what my query looks like: This is code I use: Static void Query(Args _args) { QueryRun qr; CustTable myCustTable; ; qr = new QueryRun(queryStr(MyQuery)); while(qr.next()) { myCustTable = qr.get(tableNum(CustTable)); info(strFmt("Group %1 Num %2", myCustTable.Custgroup, myCustTable.RecId)); } } The result is: AX does not sort by Count(RecId) but by the grouping. You

Axapta: Convert utcDateTime to date

坚强是说给别人听的谎言 提交于 2019-12-06 09:52:50
What is the best way to convert a utcDateTime value to a date type so I can use the global datetime functions on it? int timeDiff; date _now = systemdateget(); ; select firstOnly myUTCDateTime from _myTable timeDiff = Global::yearDiff(_now, _myTable.myUTCDateTime); info(strfmt('%1', timeDiff); Thanks The DateTimeUtil Class has methods for dealing with utcdatetime variables. In your case you would use DateTimeUtil::date . timeDiff = Global::yearDiff(_now, DateTimeUtil::date(_myTable.myUTCDateTime)); Arpan Sen Logic for utcdatetime : utcdateTime testDonedateTime1; utcdateTime testDonedateTime;

How to mimic the AOT Export by layer functionality X++?

我的未来我决定 提交于 2019-12-06 06:33:52
I am attempting to programmatically duplicate the following steps in X++ In the AOT Tree right click on the root node and click "Export" Provide a file name Click the "Application object layer" checkbox Specify "cus" as the Application object layer Export the XPO to the file I've gotten as far as bring able to export entire AOT tree but I can't figure out a way to narrow it down to just the cus layer. Here is my current code sample ... TreeNode treeNode; FileIoPermission perm; #define.ExportFile(@"c:\XPO\AOTCusExport.xpo") #define.ExportMode("w") ; perm = new FileIoPermission(#ExportFile,

Debugging in Dynamics AX

人走茶凉 提交于 2019-12-06 03:22:18
问题 I'm facing some troubles still while learning, so I guess it tends to get worse once I play with the big kids: warnings in dynamics aren't as precise and informative as VS's, there are no mouse-over tips, and exceptions to show me exactly where I've got it wrong. I'm just too used to Visual Studio, it's intellisense and all the tools (dynamics is quite new when compared to Visual Studio) More than solving simple code issues, i'd like to learn how to solve upcomming ones i might have in code

How to create an X++ batch job in Axapta 3.0?

帅比萌擦擦* 提交于 2019-12-05 13:47:52
I'd like to create a batch job in X++ for Microsoft Axapta 3.0 (Dynamics AX). How can I create a job which executes an X++ function like this one? static void ExternalDataRead(Args _args) { ... } Here's the bare minimum needed to create a batch job in AX: Create a batch job by creating a new class that extends the RunBaseBatch class: class MyBatchJob extends RunBaseBatch { } Implement the abstract method pack() : public container pack() { return connull(); } Implement the abstract method unpack() : public boolean unpack(container packedClass) { return true; } Override the run() method with the

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