x++

Axapta: Find table by name in AOT

I would like to query the AOT to see if a table name exists using X++. Can anyone point me in the right direction or provide some sample code for doing that? If table exists with the name (str tableName) provided, return true; else, return false. Thanks ...

Axapta Validation Override Always Executes Twice

In most cases, validation methods I've overridden execute twice each time the parent field is changed. Everything still works, but the InfoLog displays double messages every time. Is there any way to prevent this? Thanks public boolean validate() { boolean ret; int exlowValue; int lowValue; int highValue; int exhi...

Axapta Dialog Validation

I've found several posts and articles around the net talking about validating form fields in dialogs, but none of the examples I've found seem to work properly. Can someone post a complete, concise example of x++ code that generates a dialog containing a single text field, performs simple validation (if text = "abc") on it, and either c...

Axapta Validation Class

I've written a method to handle regex validation in AX2009. Problem is that it always returns false, no matter what the expression or input string. Returns no errors, just 'false' Mind taking a look? I'm probably missing something simple. This post has been updated to included the corrected method, without the error, so you can cut ...

Axapta: force container integer to be stored as a string

Is there a way to force a container to store all values as strings? I am using str2con in order to split text strings into containers. Any time a field with numbers only comes up, it is stored as an int, which isn't a huge problem. What IS a big problem is when the string of numbers exceeds the integer size and the number becomes somet...

How do i write a txt file using Microsoft Dynamics AX ?

I want to write a txt file (just like i'd do in visual studio with c# using string writer and everything, with which i'm already very familiar) what class and method do i use? how does it work? what's the X++ syntax? ...

Axapta: Validate Access to return value from display method

The Dynamics AX 2009 Best Practice add-in is throwing the following error on a display method override. "TwC: Validate access to return value from the display/edit method." Here is my display method. display ABC_StyleName lookupModuleName(ABC_StyleSettings _ABC_StyleSettings) { ; return ABC_Styles::find(_ABC_StyleSettings.StyleID...

How to show a row total amount by group CG Group in Report.

I am using Axapta 3.0 with language X++. I am making a report based on available report. The new report only shows a total row by group CG Group instead of showing all detail row as old report. Exam: Available report CG Code Amount Current 1-30days 31-60days 61-180days >180days 1.1 50 10 100 30 10 5 1.1 30 20 60 35 20 ...

Microsoft Dynamics AX 2009 development

I'm new to microsoft dynamics AX development, and i'd like to learn basic things about it. I have a virtual machine with the '09 version installed. Is it essential getting familiarized with the language (x++) from the beginning? What should I start with (tutorials, videos, overviews, guided tours) and where do I find it? I'd like links...

Axapta: Convert utcDateTime to date

What is the best way to convert a utcDateTime value to a date type so I can use the global datetime functions on it? int timeDiff; date _now = systemdateget(); ; select firstOnly myUTCDateTime from _myTable timeDiff = Global::yearDiff(_now, _myTable.myUTCDateTime); info(strfmt('%1', timeDiff); Thanks ...

Is semicolon really needed after declarations in x++ ?

As said in the book Microsoft Dynamics AX 2009 Programming: Getting Started it´s needed to put semicolons after declarations in x++: The extra semicolon after the variable declaration is mandatory as long as the first line of code is not a keyword. The semicolon tells the compiler that variable declarations have come to an ...

Syntax error in Ax

static void Job(Args _args) { int number=10; do { print (strfmt("current number = %1", number)); number --; }while (number != 0) } This is a job just for testing do-while in X++ , and I get a "syntax error" in the last '}' I'm new to Dynamics AX and to X++, so I don't know if there's something...

Debugging in Dynamics AX

I'm facing some troubles still while learning, so I guess it tends to get worse once I play with the big kids: warnings in dynamics aren't as precise and informative as VS's, there are no mouse-over tips, and exceptions to show me exactly where I've got it wrong. I'm just too used to Visual Studio, it's intellisense and all the tools (dy...

What is the meaning/use of #geplant in an assignment?

I'm just starting with X++ (Java background) and I found a code like #XYZBatchScheduling ; ... order.Status = #geplant; order is a record to a table with a Status column. My question: what is the meaning of #USRBatchScheduling and #geplant ("geplant" is "planned" in german) and eventually where to find it's definition. I suppose it...

How do I get the details of a SOAP fault in Dynamics AX?

I'm currently communicating with an external SOAP service within AX using the a service reference and the generated .NET class. Everything is working out greatly with the exception of how to handle SOAP faults. Ideally, this doesn't happen, but sometimes the SOAP server (which I control as well) throws a SOAP fault with a "code" and a ...

Using Dynamics AX's Business Conectors to Generate Sales Orders

So, just like the title says, I need to create an application that gets data from another Database, and shoves it through Dynamics AX's throat. This data comes from a portal, not Enterprise Portal, but a PHP one. It stores some data from the order in a separate database. So as said, I need to 'import' that to AX, creating the sales ord...

Enum as a Parameter in Dynamics AX

My report has a parameter which uses a base enum. The enum has 4 different options to choose when running the report. How do I insert an option which uses all 4 at once? For example, I have an enum named Phone and it has 4 types: 1 = None, 2 = Home, 3 = Mobile, 4 = Work. In a drop down, how do I add option 5 = None+Home+Mobile+Work? T...

Dynamics AX 2009 - Modify insert into smmActivities from ProjTableWizard?

I am an AX newbie, and I need to make a modification to the ProjTableWizard form code and have not been able to locate where I need to make the change. Essentially what I need to do is modify the part of the Wizard process when creating a sub-project. I need to figure out how a line is inserted into the smmActivities table, so that I can...

How to keep a single XPO across different versions?

I want to have one XPO, and have the same code work on AX4 and AX5. I am looking for a precompiler directive to check the version, sort of like: #if define AX4 thisCode(...) #else thatCode(...) #endif ...

Cannot find a defined variable

I'm really new to Dynamix AX 2009. I was browsing the demo image from Microsoft to better understand how the application works. I checked a random method called updateRFIDTagging() in the form SalesQuotationTable Now this last block of code really confuse me: salesQuotationLine_ds.object(fieldnum(SalesQuotationLine, ItemTagging)).skip...