axapta

Use methods in where statements

拈花ヽ惹草 提交于 2019-12-02 01:54:18
Table table; select * from table where this.id != table.id && this.foo(table); I am trying to make a selection from a table in X++ code. The table is compared against a record from the table ( this ). A record shall be added to the selection if the id of the record and another record from the table do not equal and several other conditions in foo() evaluate to true. The plan is to make this.foo(table) evaluate the record together with each other record in the table. When I insert the code from foo() directly into the call, it works just fine. However, when calling the method, it appears like

Injection safe call to IAxaptaRecord.ExecuteStmt()

允我心安 提交于 2019-12-02 00:21:26
问题 Is there an injection safe way to call via the axpata business connector string salesId = someObject.Text; IAxaptaRecord salesLine = ax.CreateRecord("SalesLine"); salesLine.ExecuteStmt("select * from %1 where %1.SalesId == '" + salesId + "'"); If someObject.Text is set to the following, i am then vulnerable to x++ code injection: "SomeSalesOrder' || %1.SalesId == 'SomeOtherOrder" Is there a way to parametrize the query, or would it be better to write all of the data access code directly in x+

Code crashes at iteration 86

空扰寡人 提交于 2019-12-02 00:10:54
static void Job47(Args _args) { str path,stx; TreeNodeIterator iter; TreeNode treeNode, treeNodeToRelease; Map dictMenuDisplay; FormName formName; MenuItemName menuItemName; container conMenu; int i,n; ; for (n=1;n<=100;n++) { info(strfmt("iter:%1",n)); path ="Menu Items\\Display"; dictMenuDisplay = new Map(Types::String,Types::Container); treenode = Treenode::findNode(path); iter = treenode.AOTiterator(); treenode = iter.next(); while (treenode) { formName = treenode.AOTgetProperty("Object"); menuItemName = treenode.AOTname(); if (dictMenuDisplay.exists(formName)) { conMenu = dictMenuDisplay

Displaying barcode in SSRS report

喜欢而已 提交于 2019-12-01 23:33:12
I am trying to display the barcode in the SSRS report. I have created a field in the report for barcode in the visual studio and changed the font type to BC C39 3 to 1 Wide format. The corresponding text that I have used to display is "hellobarcode". Whenever I generate the report, it is not displaying the barcode but the text only. Can anyone help please? I figured out the problem. When a particular field in the report is an hyperlink to other report (for drilldown purpose), it will get the default font format so that it won't display barcode font. I removed the hyperlink from the field and

Merge several dynamics AX reports in one

五迷三道 提交于 2019-12-01 14:17:50
I have the following problem: I want to merge salesInvoice reports in 1 report containing all invoices. I'm using a job that prints reports with printJobSettings, Args and reportRun classes. My parm is a ledgerJournal num and I want to print all relative invoices in one report not printing each invoice separately. How can I do to generate only one report? Basically, I take my JournalNum from LedgerJournalTrans Table, I loop on CustInvoiceJour table to have all relative invoices and execute report, I think I should override fetch method to do this, but fetch method on salesInvoice report is

Merge several dynamics AX reports in one

那年仲夏 提交于 2019-12-01 13:13:59
问题 I have the following problem: I want to merge salesInvoice reports in 1 report containing all invoices. I'm using a job that prints reports with printJobSettings, Args and reportRun classes. My parm is a ledgerJournal num and I want to print all relative invoices in one report not printing each invoice separately. How can I do to generate only one report? Basically, I take my JournalNum from LedgerJournalTrans Table, I loop on CustInvoiceJour table to have all relative invoices and execute

Unexpected Query behaviour

独自空忆成欢 提交于 2019-12-01 09:45:50
问题 I am trying to execute the following code: static void ProjTableQuery(Args _args) { Query query; QueryBuildDataSource qbds1; QueryBuildDataSource qbds2; QueryBuildRange qbr1; QueryBuildRange qbr2; QueryRun queryRun; ProjTable projTable; query = new Query(); qbds1 = query.addDataSource(tableNum(ProjTable)); qbds1.addSortField( fieldNum(ProjTable, Name), SortOrder::Ascending); //qbr1 = qbds1.addRange(fieldNum(ProjTable, Type)); //qbr1.value(queryValue(ProjType::FixedPrice)); qbr2 = qbds1

How to see the SQL expression of an X++ select statement?

廉价感情. 提交于 2019-12-01 08:25:52
问题 I have below statement in a job in AX: select RecId from pjiTable join pID, Type, PrId from sjTable where pjiTable.Prid == sjTable.PrId && (sjTable.Type == PjType::TimeMaterial || sjTable.Type == PjType::FixedPrice); I have to use it in SQL Server. How can I convert this select statement into SQL and use it in SQL Server Management Studio? 回答1: For debugging purposes you can change your select query and use getSQLStatement method on your table: select generateOnly forceLiterals RecId from

Where are the source files of AX stored?

ε祈祈猫儿з 提交于 2019-12-01 07:37:29
I would like to run a periodic (each 4 hour) backup of 'only' the source file of Dynamics Ax 2009, so, the XPO source file. I'd like to know where they are stored physically. AX7 All meta data stored as XML and methods in regular files and stored in version control. See this overview . AX 2012 The AX source (along with properties and compiled p-code and CIL ) is stored in the model store database. In AX 2012 RTM the model store database is the same as the data database (and that is stupid). In AX 2012 R2 the model store database is in a separate database, usually named xxx_Model . AX 2009 and

Where are the source files of AX stored?

落花浮王杯 提交于 2019-12-01 05:16:46
问题 I would like to run a periodic (each 4 hour) backup of 'only' the source file of Dynamics Ax 2009, so, the XPO source file. I'd like to know where they are stored physically. 回答1: AX7 All meta data stored as XML and methods in regular files and stored in version control. See this overview. AX 2012 The AX source (along with properties and compiled p-code and CIL) is stored in the model store database. In AX 2012 RTM the model store database is the same as the data database (and that is stupid)