x++

Cannot Install Dynamics ax 2012 - error OpenDatabase

不羁岁月 提交于 2019-12-02 07:42:27
问题 I'm try to install Dynamics AX 2012, but I got this error: Do you have any idea how can I solve this issue? Thanks 回答1: Do you have a bootleg installer or something? It looks like you're not even to the install wizard yet, but you're at the "launcher" style screen. This shouldn't be necessary, but just in case, re-download the install, make sure to unblock it if needed (Right click, properties, unblock), and retry it on a few different machines (your laptop?) to see if you get past the error.

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

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

How to get the results of a direct SQL call to a stored procedure?

时间秒杀一切 提交于 2019-12-01 05:14:58
I'm calling a stored procedure via direct SQL from X++, and I can't figure out how to get the integer return value from it. 0 is good, -1 is bad. // Login to SQL DB loginProperty = new LoginProperty(); loginProperty.setServer('localhost'); loginProperty.setDatabase('SQL_DB'); odbcConnection = new OdbcConnection(loginProperty); statement = odbcConnection.createStatement(); /* @in_customer_id INT ,@status INT ,@dlvmode NVARCHAR(25) ,@dlvmodedesc NVARCHAR(50) ,@tracking_id NVARCHAR(50) ,@note NVARCHAR(MAX) ,@modified SMALLDATETIME = null ,@override_email NVARCHAR(200) = null */ sqlStatement =

How to get the results of a direct SQL call to a stored procedure?

和自甴很熟 提交于 2019-12-01 02:19:27
问题 I'm calling a stored procedure via direct SQL from X++, and I can't figure out how to get the integer return value from it. 0 is good, -1 is bad. // Login to SQL DB loginProperty = new LoginProperty(); loginProperty.setServer('localhost'); loginProperty.setDatabase('SQL_DB'); odbcConnection = new OdbcConnection(loginProperty); statement = odbcConnection.createStatement(); /* @in_customer_id INT ,@status INT ,@dlvmode NVARCHAR(25) ,@dlvmodedesc NVARCHAR(50) ,@tracking_id NVARCHAR(50) ,@note