x++

Dynamics AX 2009 X++ Selecting A Date Range

拥有回忆 提交于 2019-12-11 13:19:17
问题 I am creating an X++ report, and the requirement is that the user can multi-select on a form and when they click the report menu button the values are pulled in based on the selection. So far this is easy enough, and I can pull in Str ranges i.e. order numbers, item id's etc, but I want to be able to pull in a date range based on selection. I have used a method which several MorphX reports use, with use of 3 key methods in X++ reporting; setQuerySortOrder setQueryEnableDS and the main key one

Selecting a record in Dropdown should throw error based on value in the record

痴心易碎 提交于 2019-12-11 12:14:27
问题 HI I have a dropdown for a field in a form which shows records with each record having values (Name, Status). Ex:: A1 Active A2 Active A3 Inactive A4 Active A5 Inactive If i select A3 or A5 which are inactive i should get a warning/error saying you are selecting inactive value. How can i acheive this? What is best way to acheive this? Thanks in advance. 回答1: What about using validation? Using validateField or validateWrite on the table or datasource you can test whether the chosen value is

How to filter in execute query by Date range value?

旧城冷巷雨未停 提交于 2019-12-11 12:13:21
问题 I have to made a Query in executeQuery , and I have to filter by date field, my code is : public void executeQuery() { utcDateTime dateUTC, datenullUTC; query q = new Query(); QueryBuildRange qbr; QueryBuildDataSource qbds ; QueryRun queryRun; dateUTC = DateTimeUtil::newDateTime(_dateValue, 0, DateTimeUtil::getCompanyTimeZone()); qbds = q.addDataSource(tableNum(MCRCustCategory) ); qbds.addRange(fieldNum(MCRCustCategory, ValidTo)).value(strFmt ("> %1", dateUTC) ); queryRun = new QueryRun (q);

Dynamics ax2012:How to export data using Runbasebatch

一个人想着一个人 提交于 2019-12-11 11:55:56
问题 I'm using Data Import Export Framework in Microsoft Dynamics AX 2012 in order to export custom data (TestTable) from ax to file. I successfully did that. Now I want to create a Batch job manually and then assign Batch job tasks for Staging job and Export job to execute this export in background. I don't know how to implement it, now I'm trying to create my own batch by duplicating Tutorial_RunbaseForm class. To learn how to set up execution jobs as batch jobs in AX I've started with Staging

AX SSRS Report Parameter is shown but not useable in the report

 ̄綄美尐妖づ 提交于 2019-12-11 11:55:54
问题 I want to add a parameter to a SSRS report which uses a report data provider. I searched the LedgerTrialBalanceContract class in AOT and added in the classDeclaration an attribute "CurrencyCode accountingCurrency;". After this step, i added a method "parmAccountCurrency" which look like this: [ DataMemberAttribute(identifierStr(accountingCurrency)) ] public CurrencyCode parmAccountCurrency(CurrencyCode _accountingCurrency = accountingCurrency) { //accountingCurrency = _accountingCurrency;

AX2009 - str data type limit

雨燕双飞 提交于 2019-12-11 06:34:53
问题 Is there any limit on the size of the str data type in AX2009? There is also the extended data type (Memo) which can be inherited by extended data types. What is the difference between a extended data type inherited by (Memo) and the str data type? As is not (Memo) also just a str data type? 回答1: For the limit: Yes and no. For practical purposes it is unlimited but the X++ runtime has a certain limit which you can find out by feeding large values to the strrep function until you will

Setting default value on a field?

感情迁移 提交于 2019-12-11 05:48:23
问题 I'm adding a new field to an existing Table (not a "core" one, but one that was created by an inhouse dev previously) and I'm trying to set a default value for it. I created a field of type Int , but now by default it's all 0's for the records that are already there. Is there any way to define a default value for that field, for all the existing records and to be inserted records ? Ultimately, what I'm trying to achieve is that I want a configurable field (ShowOnReport) so certain records won

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

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;