axapta

Iterating over any table

微笑、不失礼 提交于 2019-12-11 05:14:52
问题 I just started new job where they use dynamics ax 2009. I am new to this technology. Is there a way in x++ to iterate over any table? I don't know where the data comes from, it's lenght nor field count. What I mean by that is I need a function that would behave like this void convert(Table anyTable) { int i=0; int k=0; ; for(i; i < anyTable.Lenght; i++) { for(k; k < anyTable[i].Count; k++) { //some xml processing } } } (By Table i mean some kind of parent of all tables). And that basically is

How to Calculate current Sales Price of item from Code (after evaluating all trade agreements and discount offers)

陌路散爱 提交于 2019-12-11 05:09:03
问题 I need to develop a SSRS report which will list all items and their sales prices, some items have discount offers, some have trade agreements and some items have both applied on them, I am wondering if there is a built-in method which will return current sales price after taking all offers and trade agreements into account. any code example would be much appreciated. 回答1: The logic for finding trade agreements is contained in class PriceDisc . It also has a fallback if no agreements exist. On

Dynamics Ax Label not updating

ぃ、小莉子 提交于 2019-12-11 04:56:01
问题 I just edited a label using the label editor in Dynamics Ax and it was not changed everywhere. Some Forms have taken the change and some haven't. To be more precise, I modified the label: Responsible Employee in the case management. The name was changed in the big form where all the Cases are listed (Here the label change worked) but if I click on a single case to view the details, the old name still appears and I triple checked, it is the same label and there is no label with the old name in

Query object not working as expected?

Deadly 提交于 2019-12-11 04:48:19
问题 This code should be able to run on any AX system (change item & warehouse). The issue is that CustInvoiceJour is not being returned sometimes. What is odd, is if I just do a "select custInvoiceJour" with the same relations, it DOES find it? How is this possible? static void Job59(Args _args) { CustInvoiceTrans custInvoiceTrans; CustInvoiceJour custInvoiceJour; InventTable inventTable; QueryBuildRange rangeItem; Query query; QueryBuildDataSource qbds1; QueryBuildDataSource qbds2;

Move a file, AX2012

你。 提交于 2019-12-11 04:34:12
问题 I'm trying to move a file, nothing clever. The problem I am having is explained in the AX WONDERS blog. The reason for this is that when using an AX class that runs on the server, the exception never comes back to the client and therefore cannot be handled correctly.... the operation will not fall into the Exception::CRLError exception If the source file is opened by MSWord, for example, an exception is thrown in the fileLocked method, which is both infuriating yet amusing. Any suggestions

Passing Financial Dimension combination values in ax 2012

无人久伴 提交于 2019-12-11 02:29:03
问题 I need to pass Ledger Dimension value for General Journal (Table:LedgerJournalTable) form to LedgerJournalTransDaily(Table:LedgerJournalTrns) form along with combination values. EX: In General Journal form I am creating a new journal with the journal name "Alloc"(ledger dimension is like 1003), and in Financial dimension tab I am selecting Cost centre(024), department(001), purpose(training) after that I am clicking on lines, then a new form LedgerJournalTransDaily. In the from grid one filed

Axapta: Load and Save file from and to container field

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 02:27:28
问题 I need to customize AX to load an arbitrary file with arbitrary size and save it to database as a container field. I also need to read back from that container field and write the content into a file, which should contain exactly the same file content as before load. I had tried with BinaryIO, unfortunately with no luck 回答1: The answer to this question applies. Especially you should use the system class BinData and the methods loadFile and saveFile . Example: this job copies the notepad

Debug on Server side

假如想象 提交于 2019-12-11 00:42:09
问题 I have a Microsoft dynamics Ax client instance. While posting packing slip on Sales Order I have encountered some errors. So I started debugging the code but I did not find any solution. I have learned that those methods are being called on server side. Is there any possibility to debug those methods on Client side? If not how to find out in general which methods are called during the process. Please provide the answer in general way. These question is not about errors in Sales Order pacing

Axapta 2009 X++ download text file from a website

主宰稳场 提交于 2019-12-10 20:08:53
问题 I would like to download a text file from a website, given I know the URL of it. 回答1: There are a few examples in Axaptapedia.com, loading Web Documents. The examples use the Microsoft .NET Framework. The code below is from Axaptapedia: public static void TEST_DownloadString (Args _args) { System.Net.WebClient webClient = new System.Net.WebClient(); ; info(webClient.DownloadString('http://axaptapedia.com')); } 来源: https://stackoverflow.com/questions/8253012/axapta-2009-x-download-text-file

For loop across all available companies?

送分小仙女□ 提交于 2019-12-10 19:13:07
问题 I need to create a job with a for loop (I think) that goes through all available companies and checks for a specific value. I'm just not familiar with how I would get it to select each individual company. Does anyone know the syntax for that? 回答1: The functionality you're looking for is called "Cross Company" data access. MSDN has a great bit of code samples here: X++ code: http://msdn.microsoft.com/en-us/library/cc518738.aspx Main article: http://msdn.microsoft.com/en-us/library/cc634544