FAQ Database Discussion Community


SSRS Report Parameter Stripped

reporting-services,axapta,dynamics-ax-2012
I have a report that uses a stored procedure as a dataset. I am building the report dialog using a UI builder class within Dynamics AX. My parameters are being successfully passed to the dataset with the exception of my customers string. The format of which are the customer accounts...

How to refresh form when I open?

forms,refresh,axapta,x++,dynamics-ax-2012
I have a CheckBox in my TabPage on my Form, if I select the checkBox, the value is saved in a Table field (present in my FormDataSource: ParametersTable). I want to refresh the form when I enter in TabPage, just Like pressing F5. Is it possible?...

How to write in container field table from code?

table,containers,axapta,x++,dynamics-ax-2012
I have a simple question, I have in my Table a Field. This field is type container . How I can write in this field. I used this code, but don't work: MyTable myTable; str value = "value" ; ttsBegin; select forupdate myTable; conIns( myTable.FieldContainet, 1 , value ); myTable.insert();...

How can the visibility of a button in a form be changed dynamically using x++ code?

forms,axapta,x++,dynamics-ax-2012,form-control
How can I change the visibility of my button control MyButton? I have a form MyForm where I want to set the visibility property for my MyButton button control. I used this code in the form's init method: public void init() { MyTable myTable; ; while select myTable where myTable.UserId...

Hiding Country Specific Fields

axapta,dynamics-ax-2012
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...

AX2012 - Pre-Processed RecId parameter not found

reporting,axapta,dynamics-ax-2012
I made a custom report in AX2012, to replace the WHS Shipping pick list. The custom report is RDP based. I have no trouble running it directly (with the parameters dialog), but when I try to use the controller (WHSPickListShippingController), I get an error saying "Pre-Processed RecId not found. Cannot...

Using PHP to Update Dynamics AX 2012 Workflow

php,.net,axapta,dynamics-ax-2012,dynamics-ax-2012-r3
I am currently attempting to set up a PHP script to communicate with Dynamics AX 2012 and update a workflow (i.e. approve and reject), and after reading this post I believe it can be achieved using the business connector - however I also read a lot of articles advising not...

Insert pdf file using Microsoft.Dynamics.BusinessConnectorNet

c#,pdf,axapta
I need to insert pdf file to Ax database using Microsoft.Dynamics.BusinessConnectorNet.dll through a C# application. I refer this article https://msdn.microsoft.com/EN-US/library/aa868997(v=ax.50).aspx. AX column type is Container. When I insert a binary array ArgumentException says: The supplied method arguments are not valid. What should be the datatype to insert file into AX...

How to find if exist an uppercase character in string?

string,axapta,x++,dynamics-ax-2012,uppercase
I need to know if a string is at least one character or more. I need to find the uppercase character . I used this code: str testStr; int flag; testStr = "abdE2" ; flag = strScan(testStr , "ABCDEFGHILMNOPQRSTUVZ" ,flag ,strLen(testStr)); info(strFmt("%1",flag) ); But not work! A problem is that...

Why I have Field dataAreaId Access denied in a Query?

axapta,x++,query-builder,dynamics-ax-2012
I have a problem, I used in my init Form a little Query. I used this code : query q = new Query(); QueryBuildDataSource qbds; QueryRun queryRun; qbds.addRange(fieldNum(MyTable,dataAreaId)).value(SysQuery::valueUnlimited()); queryRun = new queryRun(q); if (! queryRun.prompt()) { element.close(); } MyTable_ds.query(queryRun.query()); When I insered a value in my query prompt I will...

Only foreign key constraints are allowed on this table AX 2012

foreign-key-relationship,axapta,dynamics-ax-2012,dynamics-ax-2012-r3
I have created three fields in a table: Country, State and City. I have given EDT as LogisticsAddressCountryRegionId for Country, LogisticsAddressStateId for State. The relations are MyTable.Country = LogisticsAddressCountry.CountryRegionId. I am getting a best practise error as Only foreign key constraints are allowed on this table. I tried few options...

Form control embedded to DS visible property

axapta,dynamics-ax-2012
I added the SalesId control to form from CustInvoiceTable DS. The control is not visible even with code in CustInvoiceTable DS active method. CustInvoiceTable_ds.object(fieldNum(CustInvoiceTable, SalesId)).visible(true); in AOT CustInvoiceTable.SalesId visible property is set to 'no'. If I change it to Yes, then the control is visible in the form. Is there...

Why does the `FetchMode` query property remove fields from the parent data source?

axapta,dynamics-ax-2012-r2
When opening the query SalesTableListPage from the AOT, you can choose the field MatchingAgreement (shown as "Agreement Header record ID (Record-ID)") in the field lookup. The same is not possible for query SalesUpdate, field MatchingAgreement and several others (which seem to be related to relation fields where the relation is...

How can the value of the “Quantity” field in bill of material lines be copied to the field “Height” during data entry?

axapta,x++,dynamics-ax-2009
When editing bill of material (BOM) lines, the value of field "Quantity" should be copied to field "Height". How can this be achieved? See also the following two pictures: http://www.hostingpics.net/viewer.php?id=205252BOM1.jpg http://www.hostingpics.net/viewer.php?id=282509BOM2.jpg...

Synchronize after extended data type changes

database-design,axapta,dynamics-ax-2012
I'm 100% new to Dynamics Ax and am going through the training material. It is having me create new Extended Data Types. In the past 2 hours I have been able to create 2 because each time I create one and save it takes 30min - 1 hour to "Synchronize...

AX 2009 - Shop Floor Control > Registration (time clock) job stuck in active status for one user/one job

axapta,dynamics-ax-2009
We have one user who is having issue w/clocking and his time card. If you look under his Raw Registrations in Shop Floor Control, there's a job that got stuck in "active" status a few weeks ago, and we have pinpointed this as the issue. On the screen, the column...

Dynamics ax 2012 compiler warning when seting smmOpportunityTable to common

axapta,dynamics-ax-2012
A class can receive either a VendTable, CustTable or smmOpportunityTable record. For one instance a CustTable record was usually received, and a new requirement brings an smmOpportunityTable into play, so I’m using a common record to catch it with this piece of code: (some other stuff happens earlier in the...

Hiding enum elements on runtime ax 2012

enums,axapta,dynamics-ax-2012
If you have an enum which is used in more than one place, and at one of the places you need to hide one of the elements?

Relationship between GeneralJournalAccountEntry and LedgerJournalTrans_Project

axapta,microsoft-dynamics,dynamics-ax-2012
We are attempting to relate GL transactions GeneralJournalAccountEntry with their appropriate Project Category Id LedgerJournalTrans_Project, but are having a very difficult time relating the two tables. We can get there by this route: GeneralJournalAccountEntry.GeneralJournalEntry = GeneralJournalEntry.RecId (Many to 1) GeneralJournalEntry.SubLedgerVoucher = LedgerJournalTrans.Voucher (1 to Many) LedgerJournalTrans.RecId = LedgerJournalTrans_Project.RefRecId (1 to...

Dynamics AX 2012 R2 - swapping out a preview pane dynamically depending on the record selected

axapta,dynamics-ax-2012-r2
I have a problem I'm trying to solve and I'm really not sure I'm, A) solving it the correct way, and B) able to do what I want. I have a List Page that is a basically a summary table (transportation table) that has a record in it for every...

I need code of DataManager.dll in Dynamics Ax Pos

axapta
my customer using Ax Pos and they want to an extra column in Customer Serach page: I must add the column in class but the class inside in DataManager.dll I have dll file but I cant find code of DataManager.dll. How can add the column of class? thank you....

Not all query datasources available on ListPage

axapta,microsoft-dynamics,dynamics-ax-2012
In the MSDN tutorial on adding data sources to a list page, it says Expand the Data Sources node for the list page. The node includes the query that you added and the data sources associated with that query. However I noticed not all the datasources of the query for...

Init Ledger Journal Trans offset account

axapta,microsoft-dynamics,x++
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...

Dynamics Ax 2012 Dialog - Questioning Training material

axapta,microsoft-dynamics,x++,dynamics-ax-2012
In the training material I am going over it is setting 3 DialogFields as such(I also am showing the table declaration: CustTable custTable; dlgCust = dlg.addField(extendedTypeStr(CustVendAc),"Customer account"); dlgGrp = dlg.addField(extendedTypeStr(CustGroupId)); dlgCur = dlg.addField(extendedTypeStr(CurrencyCode)); Then it tries to save the values from the dialog box into the custTable custTable.AccountNum = dlgCust.value();...

How to initialize the enum Field in a Table?

enums,axapta,x++,dynamics-ax-2012
I have two Table, TableA , TableB. In TableA I have FieldA (EnumType-Noyes) , and the same I have in TableB. I wanto to initialize with initValue method the value for the fieldA, but I have an error. I used this code: public void initValue() { TableB tableb; this.fieldA =...

How to delete AutoComplete string in dialogFieldValue in my Dialog?

caching,dialog,axapta,x++,dynamics-ax-2012
I created a Dialog I have this code: dialog dialog; DialogText dialogText ; DialogButton dialogButton; DialogField dialogFieldI, dialogFieldII; str fieldDel, confirm; MyTableDelete tabledelete; dialog = new Dialog("Dialog name"); dialog.addText("Write to confirm"); dialog.addText("DELETE"); dialogFieldI = dialog.addFieldValue(extendedTypeStr(String30), fieldDel , "Insert value"); dialogFieldII = dialog.addFieldValue(extendedTypeStr(String30), confirm, "Confirm delete"); dialog.run(); confirm = dialogFieldIi.value(); fieldDel...

How to insert a record from a Form with Dialog confirm?

forms,dialog,axapta,x++,dynamics-ax-2012
I insert with a Form records in MyTableNewRecord. In my insert Table method iI insered this code: dialog dialog; DialogText dialogText ; DialogButton dialogButton; DialogField dialogField; dialog = new Dialog("Dialog user"); dialogText = dialog.addText("Text dialog."); dialogText = dialog.addText("Click OK to continue"); dialog.run(); super(); For to insert, I use a Form....

ax 2012 - dial functionality in smmContactPerson

axapta,dynamics-ax-2012
is it possible to implement the dial functionality from the smmContactPerson (ContactInfoGrid - CommTypeIcon) in the smmContactsListPage grid? The problem is that i can add a column to the grid, but can NOT add the mouseup-event (because the form is a ListPage). Is there a way to get the mouseUp...

Modify editability of a field from field group by code

axapta,x++
I have this piece of code: controlDetails = this.form().design(1).addControl(FormControlType::Group, #quickCreateDetails); controlDetails.dataSource(fbds.id()); controlDetails.dataGroup(#quickCreateDetails); controlDetails.frameType(10); controlDetails.autoDataGroup(true); controlDetails.hideIfEmpty(false); controlDetails.columns(2); I want to modify the editability of one certain field on that dataGroup, but I don't know how to do it with code or in the AOT (DS). Seems like Im pretty much limited......

Getting array from .Net parm method

.net,axapta,dynamics-ax-2012
I am trying to use the .Net class Microsoft.VisualBasic.FileIO.TextFieldParser to read in a csv. The problem I am having is that the value of the variable netArray appears to be being set to a single string, without the values being split to separate array entries. Any idea as to why...

Wrong fields reset when method SalesLine.modifiedField is called from code

axapta,dynamics-ax-2012-r2
Take any sales order with a line that has fields SalesLine.Name and SalesLine.ExternalItemId populated. Then run following job trying to modify any field not related to the two above: SalesLine sl = SalesLine::findInventTransId('US01-000025', true); ttsBegin; sl.CustomerLineNum = 100; //any other field will serve as well sl.modifiedField(fieldNum(SalesLine, CustomerLineNum)); //causes the issue...

How to set a CheckBox value from code?

forms,checkbox,axapta,x++,dynamics-ax-2012
I have a checkBox, enum type NoYes. I want to set a value to CheckBox control in my Form equal to a Table field value, using X++ code. For example, I want have the same value for CheckBox equal to value Enum field TableA.FieldEnum. How I have to do? Thanks...

Using recordset values in SQL Server 2008 R2

c#,sql-server,sql-server-2008-r2,axapta,dynamics-ax-2012
I use Dynamics AX 2012 with business connector in C# for retrieving data by odbc methods. I'm using SQL Server 2008 R2 (version 10.50.2500 - not AX database). The code looks like this: using MIL = Miceoaodr.Dynamics.AX.ManagedInterop; ... namespae mynamespace { public class myclass { public static MIL.Session axSession =...

How to compare the DialogField value between a string with a difference uppercase?

dialog,axapta,x++,dynamics-ax-2012,uppercase
I have this little question, how I can compare the dialogField.Value() with my String, I need to have a difference between uppercase . I used this code, but I haven't strictness, I have the true return in both case , upper and lower case. dialogField = dialog.addFieldValue(extendedTypeStr(String30), text); if (dialogField.value()...

Debugging Report DP class

axapta,dynamics-ax-2012
I have noticed that I can debug the DP class of the AX standard reports using the AX debugger running on my client machine. This is not something I can do with my own custom written reports. Also, I thought this code ran in CLR on the reporting server so...

How to set Dialog text position from code?

dialog,position,axapta,x++,dynamics-ax-2012
Good day all, I have a simple Dialog started after click button, I post my code: Dialog dialog; super(); dialog = new Dialog("Dialog example"); dialog.addText(strFmt("Text to show")); dialog.addText(strfmt("SecondText to show")); dialog.run(); I will show a Dialog window loollike this : It's possible to set the position from code the Text:...

Using dialog box or creating the form?

axapta,dynamics-ax-2012
Which is the best way to do the following: I have a form_A, where is a menuitem button that opens form_B with the values taken from form_A using args. What I'm asked to do is to have an intermediate form between form_A and form_B with 1 checkbox in it and...

How to migrate AX 4.0 (SP2) on Oracle to a SQL server platform

sql-server,oracle,axapta,microsoft-dynamics
I'm facing a problem with MS Dynamics AX 4.0 SP2 while I migrate data from oracle (version 10) to SQL Server 2008 R2 and I am using SSMA tool to transfer data. The AX system with Oracle is customized in 3 layers 'var', 'cus', 'usr'. I have already done these...

Export questionnaire(KMQuestionnaireRun) results to XML

axapta,x++
How can I access the results of a questionnaire/s (KMQuestionnaireRun type) of a client to export the results to an XML dynamically. A sample of the class that I am working on: while select rmlSomaticMeasures outer join rmlSomatometryWorker where rmlSomatometryWorker.RMLRef == rmlTable.RecId && rmlSomatometryWorker.SomaticMeasureId == rmlSomaticMeasures.SomaticMeasureId { if (rmlSomatometryWorker.Value) {...

How to close the process from class code?

if-statement,axapta,x++,dynamics-ax-2012,close
I call a class form MyForm. In my class I have a if-else statements. I want to close all process, I need a command look-like element.close(); Example, my code: if (_condition a_) { //operations class; } if(_condition b_) { //abort all, and close all; } How should I do if...

Saving an SQL Server view to the Dynamics AX AOT

sql,sql-server,view,axapta,dynamics-ax-2012
I have found there are significant advantages to writing views in SQL Server Management Studio rather than creating them in the AOT. However, it appears that Views created in SQL Server are not accessible from X++ code and do not appear in the AOT. Views created in the AOT and...

AX2009 “DateFormat” of utcDateTime changes when printed to PDF from AX report

pdf,axapta,x++,dynamics-ax-2009
I have been tasked with changing the format in which the date is shown in a reporting using the a utcDateTime field. Example To change date from "5/4/2015" to "4-May-15". I have changed the field control properties in the report setting DateFormat:DMY, DateSeparator: --, DateYear: TwoDigits, DateMonth:Short name (first three...

Form data source edit method on a view - AX 2009

axapta,microsoft-dynamics,dynamics-ax-2009
I am trying to add a edit method to my grid from my data source in the form. I have the following code for the edit method: edit boolean markLine( boolean set, Datasource _datasource, boolean _mark ) { if (set) { if (!_mark) { if (selectedLines.exists(_datasource.RecId)) { selectedLines.remove(_datasource.RecId); } }...

How to add checkBox in Dialog and get value?

checkbox,dialog,axapta,x++,dynamics-ax-2012
I want to add a CheckBox in my Dialog. I used this code: Dialog dialog; DialogField dialogField; NoYesId checkValue; ; dialog = new Dialog("New dialog with checkBox"); dialogField = dialog.addFieldValue(identifierStr(NoYes) , checkValue); checkValue= dialogField.value(); dialog.run(); info(strfmt("Value %1" , checkValue)); So, in Debug I see the value of the variable (checkValue)...

How do you find a user's last used printer in SysLastValue

printing,axapta,microsoft-dynamics,dynamics-ax-2009,dynamics-ax-2012-r2
I've been trying to find where a user's last used printer is stored so that I can clear this usage data (as a few users have an issue where the remembered printer keeps defaulting to the XPS writer, despite us having KB981681 installed & the printer being available; just not...

Add a method dynamically in ax 2012 component

axapta,dynamics-ax-2012,dynamics-ax-2012-r2,dynamic-method
I want to add a method dynamically to a component in ax 2012, how can I do this through code? Is it possible?

How to keep “Show in content area” when form is open by menuitem from code?

forms,axapta,dynamics-ax-2012
On few places in our application we open ListPage in content area. On the address line there is something like "Company/Module/Folder". On that listpages are menuitems which calls class which create menuitem and open the new ListPage form like: Args args = new Args(); str param = 'Something'; MenuFunction openProjects...

Field refreshing after changing record

axapta,dynamics-ax-2012
I'm working on Microsoft AX 2012. I have weird problem, I got list page with 5 records from VendTrans table. I have created a method for getting Dimension on VendTrans table in my form Data Sources. public display DimensionValue getDimensionValue(VendTrans _vendTrans) { dimAttrValueSet = DimensionAttributeValueSet::find(VendTrans.DefaultDimension); select dimAttrValueSetItem where dimAttrValueSetItem.DimensionAttributeValueSet ==...