FAQ Database Discussion Community


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...

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...

SQL Recursive CTE 'where-used' / BOM explosion part 2

sql,sql-server,recursion,dynamics-ax-2012
Hi this carries on from another post, SQL Recursive CTE 'where-used' / BOM explosion which the original requirement was answered however I have realised I now have another final requirement. The data that I have after '1' i.e. description etc., want to repeat for each level so the description correctly...

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...

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 ==...

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...

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 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...

Error: Query with id 'DAXSecurityUsersAndRoles' does not exist. How to resolve this?

reporting-services,microsoft-dynamics,dynamics-ax-2012,ssrs-2012,dynamics-ax-2012-r3
I am trying to run a report in Dynamics AX "Menu/Sys Admin/Reports/Security/Roles and Users Attached List" which is throwing me below error Query with id 'DAXSecurityUsersAndRoles' does not exist. Anybody faced this before? What to do to fix this?...

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...

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:...

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?

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...

Enable/Find logging for Dynamics AX Odata service

microsoft-dynamics,dynamics-ax-2012,dynamics-ax-2012-r2,dynamics-ax-2012-r3
I'm trying to connect an external system to AX using the OdataQueryService. Connecting with Excel gives the correct results from the server, however I get an error when using the external system. Is there some logging on the Dynamics AX Odata service that I can enable for troubleshooting? Rob ...

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...

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...

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....

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?...

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...

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...

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()...

AX 2012 R3 CU8: System.ServiceModel.FaultException: An error occurred

dynamics-ax-2012,aif
I'm trying to update an existing sales order using AIF services. When I invoke the service operation, I get the following error message: System.ServiceModel.FaultException: An error occurred. Server stack trace: at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at...

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...

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();...

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 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 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...

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...

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?

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...

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...

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...

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...

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 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 =...

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 =...

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...