The warning is actually just because the compiler seems to be incorrectly handling the use of the ternary operator. To remove the warning, you can just rewrite as: if (custTable) commonParty = custTable; else commonParty = smmOpportunityTable; if (custTable) is the same as if (custTable.RecId != 0). It literally just...
axapta,x++,dynamics-ax-2012,dialogbox
A button has a "Text" property. You can set that property or do so by code: okButton.text("Continue"); The Box::okCancel uses the DialogBox class which is a kernel class and cannot be changed. The yesNoAxaptaForm method on the other hand uses an AX form, so you can roll on your own....
foreign-key-relationship,axapta,dynamics-ax-2012,dynamics-ax-2012-r3
The error message is probably misleading. It will be linked to the extended data type with table relation. Try following 1) Check if the EDT you are using is in the 2012 style or 2009 style (2009 has relations). If it is in the old style try to use new...
reporting,axapta,dynamics-ax-2012
Ok, so now I feel very stupid for spending so much time on that error, when it's such a tiny thing... The erronous line is that one : controller.parmReportName(ssrsReportStr(WHSPickListShipping, Report)); Because WHSPickListShipping is the name of the AX report, but I renamed my custom report clWHSPickListShipping. What confused me was...
if-statement,axapta,x++,dynamics-ax-2012,close
You can start your form with the FormRun class and close it again with formRun.close(). Remember to call formRun.wait() when you want the form to remain open and wait for an action from the user. static void openCloseForm(Args _args) { FormRun formRun; Args args = new Args(); args.name(formstr(MyForm)); formRun =...
sql,axapta,dynamics-ax-2012,cdc,change-data-capture
The field ModifiedBy is updated by the system each time a record is updated, irrespective which field is changed. So you must either: stop the data capture of the field ModifiedBy or: create your own field which is updated when the 5 fields are updated, say SomeFieldsModifiedBy The update of...
combobox,enums,axapta,x++,dynamics-ax-2012
To get the value of the ComboBox use the selection method, if(myComboBox.selection() == myEnumType::Value1) { //action } ...
Because TextFieldParser.ReadLine() is supposed to return a single string (as documented here https://msdn.microsoft.com/en-us/library/6a8fts4w%28v=vs.90%29.aspx) You should be doing parser.ReadFields() (https://msdn.microsoft.com/en-us/library/microsoft.visualbasic.fileio.textfieldparser.readfields%28v=vs.110%29.aspx) Also you've not set TextFieldType = FieldType.Delimited (as documented here https://msdn.microsoft.com/en-us/library/63k8k5sx%28v=vs.90%29.aspx) TextFieldType default value is FieldType.Delimited, so no need to set it....
1.Override enter() on created ComboBox and write this code: this.delete(enum2str(EnumType::Element1)); super(); Now run form and check. Element1 is the element which you need to hide. This worked for me....
database-design,axapta,dynamics-ax-2012
You don't have to synchronize each time you touch EDT. Only synchronize tables using this EDT (or child EDTs) - manually. If you don't know all the tables, then you have to re-synchronize full database. Synchronize is technicality required only when database related properties (string size, array) are changed. If...
axapta,x++,query-builder,dynamics-ax-2012
You cannot include DataAreaId in your queries. You can however use addCompanyRange method on your query: q.addCompanyRange("dat"); Try this: query q = new Query(); QueryBuildDataSource qbds; QueryRun queryRun; qbds = q.addDataSource("MyTable"); //Build you query q.allowCrossCompany(true); q.addCompanyRange("dat"); queryRun = new queryRun(q); if (! queryRun.prompt()) { element.close(); } MyTable_ds.query(queryRun.query()); ...
barcode,axapta,x++,dynamics-ax-2012
You have mixed up barcode printing and barcode data entry. When printing you need to process your item id into a string suitable for the barcode font. This is what the barcodeStr method do. On entry you need a scanner. The scanner gives you your item id, as if you...
microsoft-dynamics,dynamics-ax-2012,dynamics-ax-2012-r2,dynamics-ax-2012-r3
Found it: Use Service Configuration Editor to edit ax32serv.exe.config. Enable MessageLogging and Enable tracing. Change logging path + save Restart AOS Generate some traffic Analyze Ax32Serv_messages.svclog and Ax32Serv_tracing.svclog with Microsoft Service Trace Viewer.
sql,sql-server,view,axapta,dynamics-ax-2012
We had a requirement for view that could not be designed in AOT. Our workaround approach: design view in AOT with fields only (computed columns with appropriate EDTs) - just add any table (main one) create static server view method with SQL DDL (from SSMS) and execute that ddl with...
Please check whether your custom written classes extend SRSReportDataProviderBase, and those classes that you can debug extend SrsReportDataProviderPreProcess.
c#,axapta,dynamics-ax-2012,aif
I already got an answer at https://community.dynamics.com/ax/f/33/p/148074/333993.aspx from Denis Macchinetti. Answer: Denis Macchinetti responded on 29 Dec 2014 10:32 AM Hi Eros In my opinion, you can use a Dynamic Query. Take a look at http://msdn.microsoft.com/en-us/library/gg847959.aspx, Dynamic Query section. Practically, create an AOT class that extends the AifQueryBuilder class. Then...
caching,dialog,axapta,x++,dynamics-ax-2012
This is actually more complicated than I initially thought, unless I'm missing an easier way. I was able to reproduce your issue and the way I solved it was by using a method delAutoCompleteString() which exists on the formRun(), which is created when you call dialog.run() or it can be...
In validate methods you do not need to clear the field. The system does that for you when validate returns false. So instead of this.text('')) just return false. But I doubt that the idea of users entering the full name is really useful at all. If you use NameAlias as...
table,containers,axapta,x++,dynamics-ax-2012
Containers are immutable, you therefore have to assign the result of conIns to your container field: myTable.FieldContainet = conIns(myTable.FieldContainet, 1, value); Try to use myTable.FieldContainet += value; instead, it is easier to read and performs better. Second method, if exist container initialized value: container con; con = ["valueI" , "valueII"...
checkbox,dialog,axapta,x++,dynamics-ax-2012
You can only use typeId (AX 2009 and before) or extendedTypeStr (AX 2012) on extended data types (EDT), not enums like NoYes. It can be used on NoYesId, as it is an EDT. dialog.addFieldValue(typeid(NoYesId), NoYes::Yes, "Check"); You must call run before you can meaningful acquire the value. Dialog dialog =...
Don't do it like that, you're making more work for yourself. I just wrote this example for you. I hacked up a more complex piece of code I wrote, so the offsetDefaultDimension I just left in for some example code. static void Job3(Args _args) { AxLedgerJournalTable journalTable = AxLedgerJournalTable::construct(); LedgerJournalTable...
axapta,x++,dynamics-ax-2012,dynamics-ax-2012-r2
You can use .NET classes natively from X++. This code is pasted from a real method I have in production: public static container DataSet2Con(System.Data.DataSet _dataSet) { System.Data.DataTableCollection dataTableCol; System.Data.DataTable dataTable; System.Data.DataRowCollection dataRowCol; System.Data.DataRow dataRow; int dataRowCount; System.Data.DataColumnCollection dataColCol; System.Data.DataColumn dataCol; int dataColCount; ... dataTableCol = _dataSet.get_Tables(); dataTable = dataTableCol.get_Item(0); dataRowCol...
microsoft-dynamics,dynamics-ax-2012,dynamics-ax-2012-r2
The label is on \Data Dictionary\Extended Data Types\CustRef and is @SYS23010. Change it there and it will reflect everywhere it is used....
axapta,datetime-format,dynamics-ax-2012,dynamics-ax-2012-r3
I fixed this issue. I changed the Property of "TimeZoneIndicator " property to "Never" on form field level. That fixed the issue.
It happens when the menuitem which is not in any menu is used. So the solution is use menuitem which exist somewhere in the menu. I also see this behavior when the callers args are used instead of creating new Args() like: public static void main (Args _args) { MenuFunction...
barcode,axapta,dynamics-ax-2012
The decoding logic in class BarcodeEAN128, methode decode treats the GTIN (which is identified by the 01 application identifier) as a fixed length field of length 14 (compare to the macro EAN_LEN in the class declaration). Since your ItemId only has 5 characters, the following characters that would define the...
axapta,microsoft-dynamics,dynamics-ax-2012,ax
Try creating a union query and then a view based on that query. Maps are supposed to be used only in X++, and not as data sources in forms....
Do not make it harder: qbds.addRange(fieldNum(HcmEmployment,LegalEntity)).value(SysQuery::valueNot(0)); The reason for your failed query expression was the use of queryValue("0") which quotes the zero. Changing that to 0 would work as well, but again too laborious. And even shorter is: qbds.addRange(fieldNum(HcmEmployment,LegalEntity)).value('!0'); To diagnose query errors take a look on the SQL generated:...
axapta,microsoft-dynamics,dynamics-ax-2012
There is not a one-to-one relationship. The closest thing would be to use Voucher and TransDate on LedgerJournalTrans to fetch ledger transactions. See this post. There is a white paper describing the AX 2012 ledger posting framework....
axapta,x++,dynamics-ax-2012,dynamics-ax-2009
In AX2009 table method PurchTable.checkUpdate: salesTable = SalesTable::find(this.InterCompanyOriginalSalesId); ...
enums,axapta,x++,dynamics-ax-2012
You have only declared TableB in the initValue() method and have not initialized it with any record. This is basically the difference between: Class1 class1 and Class1 class1 = new Class1(). So you need to do: TableB tableb = TableB::find('SearchArgument'); if (tableb) this.fieldA = tableb.fieldb; ...
c#,sql-server,sql-server-2008-r2,axapta,dynamics-ax-2012
Polupate data from odbc can be done in several ways, and not just odbcDataReader (which is inconveniant way, because need to get record by record). When using OdbcDataAdapter class, like the link https://msdn.microsoft.com/en-us/library/system.data.odbc.odbcdataadapter%28v=vs.110%29.aspx Also the following code may help: ... OdbcDataAdapter d; DataTable dt; d = new OdbcDataAdapter(cmd); d.Fill(dt); ......
dialog,axapta,x++,dynamics-ax-2012,uppercase
To make a case sensitive string comparison in AX, use the strCmp function: if (strCmp(dialogField.value(), "TEXTCONFIRM") == 0) { // other code } See X++, C# Comparison: String Case and Delimiters [AX 2012] and strCmp Function [AX 2012]...
forms,dialog,axapta,x++,dynamics-ax-2012
you should not write code that allows user interaction(ie a dialog) during a transaction https://msdn.microsoft.com/en-us/library/aa609617.aspx...
The help on the Visible property of a fields reads: Determines whether the field should be visible in the user interface. If set the field is not shown in forms or reports, nor can it programmatically forced visible (other than changing the field property!). The only other option is to...
axapta,microsoft-dynamics,dynamics-ax-2012
You won't have all AX tables in your StoreDB. In StoreDB, you just have relevant tables you need in standard Retail process (cash&carry, inventory, etc...). If you need to get other standard tables or specific tables, you have to: - add those in StoreDB SQL schema using specific SQL script...
sql,sql-server,recursion,dynamics-ax-2012
Here is a version that is easy to understand and maintain: ; WITH CTE AS ( SELECT B.RECID AS MainID , B.ITEMID AS MainItem , BV.NAME , BV.ITEMID AS ParentItem , ECPT.NAME AS ParentItemName , B.BOMQTY , B.UNITID , B.BOMQTYSERIE , 0 AS [level] FROM #BOM B JOIN #BOMVERSION BV...
Check AIF Exceptions in the AX (System administration - Periodic - Services and Application Integration Framework - Exceptions). You can also enable message logging on the Inbound port (under Troubleshotting select All document versions) and Include exceptions in fault. Don't forget to disable in production or periodic cleanup. ...
php,.net,axapta,dynamics-ax-2012,dynamics-ax-2012-r3
You should use AIF (Application Integration Framework). Then you can call AX AIF services via SOAP (Web Services). Use HTTP adapter instead of default NetTcp (or configure it to use BasicHttp). See https://technet.microsoft.com/en-us/library/hh496418.aspx for the instructions of configuring HTTP Adapter. For workflow actions AIF service is already created (\Services\SysWorkflowApprovalService)....
axapta,microsoft-dynamics,dynamics-ax-2012,dynamics-ax-2009,ax
When you are opening a menu item from GlobalToolsMenu it isn't associated with the current form, it works as if you are trying to open a menu item from an independent menu. If you need to get access from the called class to the current form you need to use...
You can use Dialog to prompt the user: Dialog dialog; DialogField field; ; dialog = new Dialog("My Dialog"); dialog.addText("Select to display negative values:"); field = dialog.addField(extendedTypeStr(NoYesId)); dialog.run(); if (dialog.closedOk()) { info(field.value()); //Add result to args ... } // Call the form ... But I would suggest using a simple DropDialog...
dialog,position,axapta,x++,dynamics-ax-2012
You can center the text using the form control: Dialog dialog = new Dialog("Dialog example"); DialogText t1 = dialog.addText(strFmt("Text to show")); DialogText t2 = dialog.addText(strfmt("SecondText to show")); FormStaticTextControl c1 = t1.control(); c1.widthMode(FormWidth::ColumnWidth); c1.alignment(FormAlignment::Center); dialog.run(); The first control is now centered (to the surrounding group). You have to give it ColumnWidth,...
You have two problems: Use _vendTrans.DefaultDimensioninstead of VendTrans.DefaultDimension in line 3. That is why the same value is in all lines, you are referencing the active record in stead of the record of the grid line. Use display method caching to improve performance of the form. To fix both move...
data-type-conversion,dynamics-ax-2012
The AX TimeOfDay type is number of seconds from midnight. You can use time2Str function or use div and mod operand to calculate hours and minutes. Example: info(time2Str(31501, TimeSeparator::Colon, TimeFormat::AMPM)); ...
You have to create Display Menu Item with the selected form. Then you can set newly created menu item for the FormRef property of the Table....
axapta,dynamics-ax-2012,number-sequence
Update the NumberSequenceTable.NextRec value to the desired value. Make sure that format is correct. Example code: NumberSequenceTable numberSequenceTable; ttsBegin; select forUpdate numberSequenceTable where numberSequenceTable.NumberSequence == 'Acco_1' // as example ; numberSequenceTable.NextRec = 11; if (numberSequenceTable.validateField(fieldNum(NumberSequenceTable, NextRec)) && numberSequenceTable.validateWrite() ) { numberSequenceTable.update(); } else { throw error("Validation failed"); } ttsCommit;...
reporting-services,microsoft-dynamics,dynamics-ax-2012,ssrs-2012,dynamics-ax-2012-r3
This menu item is not standard and must be your customization. Check your XPO import.
If you make a list page as a copy of SysBPStyle_ListPage you do not change the behavior. List pages are read only by definition. You may use a simple list or another form template. Forms started by double clicking on a list page item can be set to edit mode...
axapta,microsoft-dynamics,dynamics-ax-2012,dynamics-ax-2009,ax
Set the grid's AutoDeclaration = Yes then call this code, replacing grid1 with your actual grid control: #define.taskSelectAll(778) element.selectControl(grid1); element.task(#taskSelectAll); OR if you don't want to set the AutoDeclaration = Yes and avoid the added overhead, you can do this: #define.taskSelectAll(778) element.selectControl(element.control(element.controlId('Grid1'))); element.task(#taskSelectAll); ...
axapta,x++,microsoft-dynamics,dynamics-ax-2012,morph-x
Modules are called models in AX lingo. Read all about Models, Layers, and the Model Store and Working with Models in AOT....
string,axapta,x++,dynamics-ax-2012,uppercase
The code below tests if a string is one character or more and afterwards finds all the uppercase characters. Numbers are ignored since they cannot be uppercase. static void findCapitalLetters(Args _args) { str testStr = "!#dE2"; int i; int stringLenght = strLen(testStr); str character; //Find out if a string is...
TableId tableId = pickTable(); FieldId fieldId = pickField(tableId); info(tableId2name(tableId)); info(fieldId2name(tableId, fieldId)); OR public void lookup() { SysTableLookup sysTableLookup; SysDictField sysDictField; TmpTableFieldLookup tmpTableFieldLookup; Enumerator en; super(); en = SysDictTable::newName(tableStr(InventTable)).fields(false, true, false).getEnumerator(); while (en.moveNext()) { sysDictField = en.current(); tmpTableFieldLookup.TableName = sysDictField.tableName(); tmpTableFieldLookup.FieldMethodName =...
axapta,microsoft-dynamics,x++,dynamics-ax-2012
CustTable.AccountNum field in CustTable is of CustAccount type, which extends CustVendAc EDT. So basically, they both are of the same type. CustTable.CustGroup is of CustGroupId type, so it is ok. CustTable.Currency is of CustCurrencyCode type, which extends CurrencyCode. Use existing methods to validate the record before inserting the record into...
axapta,microsoft-dynamics,dynamics-ax-2012
DataSources with JoinMode ExistJoin or NotExistJoin are not available. And make sure that query version on the Data Sources of the list page is same as the query version in the AOT. If not click into Query property and press Enter. See https://msdn.microsoft.com/en-us/library/aa880078.aspx...
axapta,x++,dynamics-ax-2012,morph-x
"Unretrieved" fields are newly created fields which AX 2012 AX by error treats badly. It may also appear if a form query does not contain a field in the field list. You problem is solved by restarting the client or the AOS or both. Or in the second case just...
forms,checkbox,axapta,x++,dynamics-ax-2012
Use datasource and dataField methods on the control: mycheckBox.datasource("TableA"); //Data source name mycheckBox.dataField(fieldNum(TableA, FieldEnum)); Don't forget to set AutoDeclaration of the myCheckBox control to Yes....
forms,refresh,axapta,x++,dynamics-ax-2012
There is a great article about different methods of refreshing the form's data here. Here are the basic outline: 1. Refresh This method basically refreshes the data displayed in the form controls with whatever is stored in the form cache for that particular datasource record. Calling refresh() method will NOT...
You have to change the property CountryRegionContextField of the corresponding control to point to the field which has CountryRegionCodes value set (either on table level, or EDT level). I guess you have to explicitly set this property because you can have different forms with the same table as data source,...
axapta,dynamics-ax-2012,dynamics-ax-2012-r2,dynamic-method
Here is a job I wrote that demonstrates a bunch of different ways of doing what you're wanting: static void Job79(Args _args) { TreeNode treeNode = TreeNode::findNode(@'\Classes\Activities'); SysDictClass sysDictClass = new SysDictClass(treeNode.applObjectId()); FormRun formRun = new FormRun(new Args(formStr(AifAction))); Form form = new Form(formStr(AifAction)); ClassBuild classBuild; SysDictTable sysDictTable = new SysDictTable(tableNum(AccountSumMap));...
axapta,dynamics-ax-2009,dynamics-ax-2012,dynamics-ax-2012-r2
There is no such direct relation. Usually the invoice issuer provide a payment id (from the payment slip) to be used on the payment. When paying you are supposed to provide the payment id but no law of nature force you to do so. The payment id may be an...
axapta,dynamics-ax-2012,dynamics-ax-2012-r2
It goes from VendPackingSlipJour -> VendPackingSlipVersion -> SubledgerVoucherGeneralJournalEntry -> GeneralJournalEntry It seems there may be more than one VendPackingSlipVersion record per VendPackingSlipJour, then use the VendPackingSlipVersion.findLatest method to find the relevant one. This paper may be of help regarding the ledger rubbish in AX 2012....
I don't think mouse events can be monitored by the interaction class. What about using a good old button?...
Yes you can retrieve the filters by getting the form's queryRun's query and packing that into a container to be stored/passed/unpacked. The form has a query, that is passed to QueryRun, then the users puts filters/dynamic joins/etc on that query that belongs to the QueryRun. So you need the modified...
This is what finally worked for me (source). Please note, that InventDim wasn't my main Data Source in this form. InventTransOrigin was the one, but it didn't worked. So I guess, you can have this method if you don't want to show any warnings to the end user: public boolean...
In my experience this problem usually occurs if the pack/unpack pattern that is used to transfer class attributes from one tier to the other was not implemented for the class. Your comments indicate the same (initialization on client, execution on server)....
reporting-services,axapta,dynamics-ax-2012
It does appear that the reporting services treat semicolons as special characters. The solution I came up with was to modify my string by changing all the semicolons to commas, but I did this in the PreModifyContract method instead of using SysQueryHelper. Obviously I then had to modify the logic...
axapta,dynamics-ax-2012,dynamics-ax-2012-r2
There is! It's using AX's drilldown functionality which uses AxHLink.exe to handle dynamics:// URLs, which are passed to the Classes\SysStartupCmd function. You could also create some custom code there if you wanted to launch the AX client executable directly. My question I asked some while back should have a great...
axapta,microsoft-dynamics,dynamics-ax-2012,dynamics-ax-2012-r2
The classes you are looking for are \Classes\SalesFormLetter_Invoice - For interacting with SalesEditLines \Classes\SalesInvoiceJournalCreate - Creating journal data \Classes\SalesInvoiceJournalPost - Posting a journal \Classes\SalesInvoiceJournalPrint - Printing \Classes\SalesFormletterParmDataInvoice - Creating parm data The specific method you probably want is \Classes\SalesInvoiceJournalPost\postJournalPost, which is executed after the journal has posted from \Classes\FormletterService\run#91 Refer...
forms,axapta,x++,dynamics-ax-2012,form-control
FH-Inway's answer is correct from a code-perspective, but I want to comment that what you're doing is incorrect and won't function properly unless your mineTable only has 1 matching record. Currently as written, when the form is instantiated, you basically loop over mineTable and toggle the myButton visible and hidden...
It does not sound cool, but I think you will have to provide the mapping table yourself between the Timezone System Enumeration and the name valid to Instantiate a TimeZoneInfo Object. The list of names should be quite static, but remember to catch TimeZoneNotFoundException and InvalidTimeZoneException when using FindSystemTimeZoneById....
try-catch,axapta,x++,dynamics-ax-2012
AX (X++) is strange here (if you are used .NET/Java like try/catch scenario). If you have try inside the transaction, then fist catch cathes the excation (which is Enum and not sort of exception object). From the MSDN: Exceptions Inside Transactions: When an exception is thrown inside a ttsBegin -...