FAQ Database Discussion Community


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

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

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

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

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

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

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

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

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

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

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

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

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