Injection safe call to IAxaptaRecord.ExecuteStmt()

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

Axapta Create a View From a Table not authorized Dynamics AX 2012

I am just following a very simple microsoft tutorial, at the topic Create a View From a Table: I created the view called TITO_SomeView . I used the DirAddressBookParty table, I can't open the view and I am getting the message: "You are not authorized to access table ‘Some view’ (TITO_SomeView). Contact your system administrator."

Axapta AIF or Data Migration Framework [AX 2012]

I was importing some entities to AX 2012 using AIF and consuming the web services through an C# ASP.Net application. I already made it for Customers,Vendors,Workers,Chart of Accounts and now starting General Journals. Some customization I could find a workaround using the AIF Document Service Wizard: Creating the DUNS number using a service for the DirDunsNumber table, later associating the customer with the new created DUNS Number. On the Products data migration will need a lot of customizati

Axapta retrieving value via SQLDataReader.get_Item()

I am trying to access external sql-tables via the following code. Accessing works as intended, but I have problems to process the values, if datatype has to be casted for futher processsing. The following code can be executed as job in ax: static void Job1(Args _args) { str serverName; str catalogName; str ConnectionString; str sqlQuery; System.Data.SqlClient.SqlConnectionStringBuilder connectionStringBuilder; System.Data.SqlClient.SqlConnection connection; System.

Axapta Setting default value on a field?

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'

Axapta Building and using QueryRun in x++

I have a need to be able to dynamically build a query in X++. I can do so and make it work. My question is: Is there any way, using the Query classes, to get the entire result set in 1 buffer. I understand the: While(queryRun.Next()) { common = queryRun.get(tableName2Id('InventTable')); } but this just does it record by record. I am wanting the entire result table at once. Any ideas? I have been searching for a long time. Thanks

Axapta cannot insert multiple records in accounting distributions (accountingdistribution)

when I'm trying to post the Free text invoice in AX 2012 I'm getting following error: "cannot insert multiple records in accounting distributions (accountingdistribution". I cannot go to the error line even if 'execute business operations in CIL' is unticked Can you guide me to correct way how to solve this kind of (cannot insert multiple records) errors? Thanks in advance.

Axapta test data transfer tool for microsoft dynamics ax 2012 r3?

i have a licensed version of microsoft dynamics ax 2012 r3, but i need the test data transfer tool to import data into the database. The links provided by microsoft redirect me to lifecycle services page where on registration i dont get access to the tool. If someone could be helpful and provide me a working link to download test data transfer tool. Thank you !!

Axapta is it necessary to revert something when using return inside a changeCompany

I have to add a control inside a changeCompany() in an existing class. I suppose the code below is OK, but I have a doubt : Does the "return" order imply that a return to the original company is done ? Or is there to add a statement, unknown by me, something like revertToPreviousCompany()? try { changeCompany(companyId) { // the method will produce a message and return false if an error if (!this.doSomeChecks()) { return; }

Axapta 2009 AOT Reports

Currently I am working in a Report sections. In this I have one doubt. In my Report I have 3 tables with relation on one field. I want to filter the data based on that common field I used in the JOIN query.

Axapta Cursor moves to top when refreshing list page grid

Fellow developers, I have a custom list page, where a user can select few records, hit a button in Action pane that runs some logic in a class, and all that works fine. My problem is that the cursor does not stay at the same record but goes to the top of the grid. Sounds like a familiar issue? I store the FormDataSource of the list page using args in the custom class that has all the logic. I tried few things but none worked. formDataSource.research(true) True parameter is supposed to retain

Axapta Operand Types Are Not Compatible With The Operator

I am receiving the error Operand Types Are Not Compatible With The Operator in the title when trying to compare two "real" datatypes. Can anyone help me out with what is wrong? public void clicked() { real localAnnualUsage = itemSetup_DS.AnnualUsage(); real localSalesPrice = itemSetup.StockPrice; real localCost = itemSetup.StockCost; real localstockInventAvg = itemSetup.StockInventAvg; real localTurnAndEarn; real localAnnualGP

Axapta LEFT JOIN in Dynamics AX View

Does anyone know how to do a LEFT OUTER JOIN in a Dynamics AX View from the AOT (not a programmatically-created query). Can't seem to find a way to do anything other than an INNER JOIN, and the documentation seems to indicate it isn't possible. This seems to be a huge weakness, so I figure if they don't support it, there is a recommended way to accomplish the same thing. Thanks

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

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.

Axapta Modifying fields editability on a table level

I have 2 tables, 1st table fields editability depends of a value of a NoYes enum from another related table. I want to know the best way to prevent edition of the fields on a table level. I thought throwing an exeption on validatefield, but I don't know if it's the best way. Thanks!

Axapta Execute report by code and filter values AX 2009

I Need execute CustAccountStatementExt report by code in AX 2009, but I need execute this report by some filter for example CustAccount field of CustTable. Create a Job to do this, the report execute OK, but without CustAccount filter or any other filter. Code: static void SavePdfFileCustAccountExt(Args _args) { Args args; ReportRun report; CustTable recCustTable; ; args = new Args(reportstr("CustAccountStatementExt")); recCus

Axapta Correct form to pass value to IntEdit and StringEdit from a method dynamics ax

I dont know what is the correct form to pass values from method to the fields, I already put yes on autodeclarate and check if the value I send from the method match with the type of field, I dont have any error only doesn't work. In fact it works with the IntEdit but for example when I send 500 shows me 1 I dont hunderstand why This is my code private void method1(){ int var = 500; Field.value(var); } And I would like to know how to pass that values from the method to StaticText.

Axapta AX 2009: Need to print ProForma Invoice before the invoice has been posted

So my company has tasked me with creating a batch job that will print out Proforma sales invoices for all of the sales orders that have had the packing slip posted that day, but have not had the invoices posted yet. They are asking for this because they wish to review the invoices through PDF files before actually posting them. Most likely so that they can post in all of the approved invoices in one process. So far all of the examples of how to create this batch report run (that I can find thro

Axapta AX 2012 Form with Query shows empty line when now record is found

I have a Form with a Query, the records are shown in a Grid. When the query returns no result an empty line is shown, when the user presses F5 to refresh it shows the expected "grid is empty" message. What can I do to get the expected "grid is empty" message without pressing F5?

Axapta Invoke Helpform from extended data types [enum]

I have a problem with Extended Data Types Enum with HelpForm, the form (HelpForm) doesn't open on action. But if I use a string extended data type and set property HelpForm, the form is run on click ButtonImage (similar to extended data type FileNameSave). Does AX 2009 support HelpForm in enum extended data types?

Axapta Crosscompany Property is not working

I have a cross-company property ("Yes") enabled query.,even though query returns values for the current company in Dynamics 365 (AX7) I even tried with changecompany() but there is no data for any other companies apart from current company. _query.allowCrossCompany(true); qr=new QueryRun(_query); while( { companyInfo =qr.get(tableNum(CompanyInfo)); info(strfmt("%1",companyInfo .DataArea)); } here query is cross company query but still it showing the values for current company o

Axapta Security : How to determine roles of a user created through an Active Directory Group

I am currently using AD groups to manage roles and access to Dynamics AX 2012. So for example I have and AD group called GG_AX_SalesRepresentative and it is used to allow everyone in the group to log on to Dynamics AX and to receive the corresponding role in Ax. So this is working and users that log on to Dynamics Ax and are member of the group will automatically be created within Dynamics AX and receive a $CA2D like userId. They have no role assignments because AX knows that they came from the

Axapta Why is IDMF not supported on AX 2012 R3

I see that IDMF was released today and it's supported for every 2012 version barring R3. Is there another product that'll take it's place? Is the development team still working on the R3 version?

Axapta Lookup on ListPage Dynamics AX 2012

I've tried to create control with lookup so client can choose Vendor and filter grid with this data but I dont have any idea how to create lookup on ListPage when I cant override any method.

Axapta Ax 2012 custom lookup

I want to create look up of 3 tables and their fields , my requirement is in the first field i would like to show the 3 table names as look up and in the second field i would be showing all the fields of the table selected in the first field. For e.g if i have Route, sales basket and Invent table in look up of first field, i select Invent table in the first field then in the second field i have to show all the fields of invent table as look up. please help me in this regard. I have tried usin

Axapta Init Ledger Journal Trans offset account

I am trying to create (and post) ledger journals from data received via AIF inbound service. The data is written in a custom staging table with all necessary fields. Now, I need to create journals and journal trans records from this staging table. I am able to create LedgerJournalTable record with multiple LedgerJournalTrans records. Here is a code snippet for creating LedgerJournalTrans: ledgerJournalTrans = this.initJournalTransFromStaging(ledgerJournalStaging); ledgerJournalTrans.initVal

Axapta Check objects type

I am using a C# application to do some work and send back the results in AX via a service. I've created a few classes in AX and use their instances in C# then I send the objects back with the help of a classic array. In AX I receive the stuff in a System.Collections.ArrayList and here comes my question: How can I iterate over this collection and check the objects type? for (...) { if (arr[i] is SalesLineCSharp) { } else if (arr[i] is SalesTableCSharp) { } //etc.... }

Axapta AX 2012 Group by with common table

How to group by a common table with a specific field? I'm getting a syntax error on (dt.fieldname2Id('BatchNo')) Here's my code: Common common; SysDictTable dt; dt = SysDictTable::newName('Table1'); common = dt.makeRecord(); while select count(RecId) from common group by common.(dt.fieldname2Id('BatchNo')) //syntax Error here where common.(dt.fieldname2Id('flag'))==1 { info(int642str(Common.Recid)); }

Axapta Max() inner join

I have two tables. DOCUMENT and REVISION I want to make a list of all documents and show the latest revision. It works fine to find MAX(revision.autonumber) but as soon as I do inner join I no longer get the correct result. I then get not only the MAX(revision.autonumber) but also earlier revisions. Thanks for your help I have tried the query below (and many other attempts) select document.ItemId, document.Name, Max(revision.autonumber) from document inner join revision on document.ItemId =

Axapta NumberSequence - Dynamics ax 2012

I need help. I'm trying to add a few auto-generated number sequences in my tables. I'm doing it by using loadModule() in Class NumberSeqModuleMine: NumberSeqDatatype datatype = NumberSeqDatatype::construct(); datatype.parmDatatypeId(extendedtypenum(IdStuffSeq)); datatype.parmReferenceHelp(literalstr("@SYS32633")); datatype.parmWizardIsContinuous(true); datatype.parmWizardIsManual(NoYes::No); datatype.parmWizardIsChangeDownAllowed(NoYes::No); datatype.parmWizardIsChangeUpAllowed(NoYes::

Axapta Passing parameters to parameter dialog for Query-based reports

I have a query-based report in which the query has some interactive ranges enabled on them. This is great except the value is blank, or has the last values used pre-populated. One of these is Vendor account number. If I wanted to have this report to pre-populate the Vend account based on whichever Vendor account record is selected (the caller), how would I be able to achieve this?

Axapta Similar Function to MenuItemDisplayStr() as non-intrinsic? (AX 2012)

I am writing a class that needs to validate a string as an existing menuItem. Ideally, I would need something similar to MenuItemDisplayStr(), but I need it to use that function at runtime as opposed to compile time. Is there something similar that can check a string if it is a menuItem? Thank you for the help!

Axapta Background color row

I have created a display method on a datasource of a form to check for a match on a certain field, if there are 2 of the same values, the specific row in the form should get a background color. The problem with below code is that all lines in the form are given the background color, also if only 1 line record matches. What am I doing wrong? public void displayOption(Common _record, FormRowDisplayOption _options) { SalesLine salesLineLocal; ; salesLineLocal = _rec

Axapta X++ Compute columns

I try recreate SQL view in AOT and I need add compute column which reference view (FISCALCALENDARFLATTENEDVIEW). In the class I cannot retrieved fields for this view. Problem is with "sGREGORIANDATE = " line where I specify a fieldStr(), cannot do it for View. I put SQL statement just to help understand what I try achieve. CREATE VIEW [dbo].[vw_DimFiscalPeriod] AS SELECT T1.RECID AS LEDGERRECID, T1.PARTITION AS PARTITION, T1.RECID AS RECID, T2.CALENDARID AS CALENDARID, T2.CALENDARRECID A

Axapta Adding Deployable Package to Development VM D365

We have a development VM for Dynamics 365 for finance and operations, I am trying to add a pre-developed customized package to our development virtual machine using the following command: AXUpdateInstaller.exe devinstall But the following error continue to pops-up: Exception calling "CreateRuntimeProvider" with "1" argument(s): "Serialization version mismatch detect, make sure the runtime dlls are in sync with the deployed metadata. Version of file '181'. Version of dll '172'." I searched

Axapta Number sequence for custom table in ax 2012

I have a custom utility which uses a custom table in AX 2012 AOT, I want to have an identity field for my table and someone tell me I can use number sequences for this, and can map a number sequence to my table so it can get a new unique id at the time of row insert, when I try to generate number sequence it asks me AREA and module information, since i want this for my custom table and utility which is working outside the dynamics ax 2012 using .net business connector, I am unable to figure out

Axapta Query to fetch table names from AX takes too long

I am using the following code in X++ to get table names: client server public static container tableNames() { tableId tableId; int tablecounter; Dictionary dict = new Dictionary(); container tableNamesList; for (tablecounter=1; tablecounter<=dict.tableCnt(); tablecounter++) { tableId = dict.tableCnt2Id(tablecounter); tableNamesList = conIns(tableNamesList,1,dict.tableName(tableId)); } return tableNamesList; } Business connector code : tablesList =

Axapta How to Lookup using view

I went through the method of automatic look up here: What I am trying to achieve is that automatic look up using the view instead of table. Do you have any idea for that?

Axapta Import PDF files in AOT?

I have an Enterprise Portal application that was successfully deployed in another environment, but it seems that a lot of content was added through Sharepoint Designer after it was initially deployed, such as PDFs that are displayed on the EP application's page. So they are missing in the new instance. I don't seee them anywhere in the AOT, so is there anyway to package all those images and PDFs in the AOT so next time I deploy an instance of this application, everything deploys at once ? Than

Axapta How to add an extra row to a custom lookup query?

I created a custom lookup on the ProdBom table and it just displays the BOM items for a given production order so that a user can select only items listed on the BOM. I also want them to be able to select the produced BOM item (ProdTable.ItemId) in the list (1 extra item). How could I do this? Here is my current lookup: static void lookupItemIdBOMSubset(FormStringControl _ctrl, ProdId _prodId) { SysTableLookup sysTableLookup = Sy

Axapta SysOperation Framework suppress infolog messages for ReliableAsynchronous but keep them in batch history

I'm just getting my feet wet with the SysOperation framework and I have some ReliableAsynchronous processes that run and call info("starting...") etc. I want these infolog messages so that when I look in the BatchHistory, I can see them for purposes of investigating later. But they also launch to the client, from the batch. And I can tell they're from the batch because you can't double click on the infologs to go to the source. Is there someway to either suppress these from popping up on the

Axapta X++: Highlighting all records in a grid from a code (including not loaded ones)

I can't workout this seemingly simple task. I have a custom CheckBox named PrintAll and what I want is once it gets selected, all rows in a grid gets selected/highlighted. Here's what I have tried: Option 1: Passing CTRL+SHIFT+END. The example below passes CTRL+A combination. public boolean modified() { boolean ret; ret = super(); #task if(PrintAll.value()) { // CTRL+A element.task(#taskSelectAll); } return ret; } Result: selects only loaded re

Axapta Hiding Country Specific Fields

I have the following problem. The LogisticsPostalAddress form is displaying the StreetInKana field. (this holds special characters used in Japan". The underlying EDT extends an EDT which has 'JPN' in the CountryRegionCodes property. The company I am using has primary address with country'GBR'. My understanding is that this should mean the field would be hidden, but it is not. So far we have made very few changes to standard AX code, and nothing that would be related. So either I have set someth

Axapta What database does Commerce Runtime make use of?

I have a storemanager dashboard which makes use of Microsoft Dynamics AX database. To avoid writing a lot of code, I plan on using CRT (commerce runtime) which would give me some form of abstraction and also saves my time writing a lot of code by using other integration methods like AIF and .net business connector. But, my doubt is, the description of CRT says that it makes use of CRT channel database. Will it have required amount of data that ax database would have and is it the right way t

Axapta Ax 2012 disable row on form

I want to disable (Non - Editable or Greyout) a complete Record ( Row ) in a Form by Unchecking a Check BOX in that record. In my code disable all record of the form if(MyTable.ChechBox==NoYes::Yes) { MyTable_ds.allowedit(false); }

Axapta How to change command of formcommandbuttonControl dynamically in d365?

I have a form with a formCommandButtonControl in d365. I want to change the command associated to the button dynamically according to the condition in the code. I can't find any base enum to choose the value. switch (x) { case 1: formButton.command(New); break; case 2: formButton.command(DeleteRecord); break; } This is the property in the form How can I choose New and deleteRecord value in x++ code?

  1    2   3   4   5   6  ... 下一页 共 6 页