Skip to main content

Posts

Export from custTable to Excel file in axapta

To Export Records from custTable to Excel  file in  axapta You can try following code. static void ExportingFields4mCustTable(Args _args) { CustTable CustTableLocal; SysExcelApplication excelApp; SysExcelWorkSheet excelWorksheet; SysExcelRange excelRange; SysExcelCells excelCells; SysExcelCell excelCell; ComVariant cellValue; Int i=1; ; excelApp = SysExcelApplication::construct(); cellValue = new ComVariant() ; excelApp.workbooks().add(); excelWorksheet = excelApp.worksheets().itemFromNum( 1 ); excelCells = excelWorksheet.cells(); while select * from CustTableLocal { excelCells.item(i+4,4).value(cellValue.bStr(CustTableLocal.AccountNum)); excelCells.item(i+4,5).value(cellValue.bStr(CustTableLocal.Name)); i++; } excelApp.visible(true); }

Create report runtime in axapta through code

This is code sample to Create report runtime in axapta through code static void MakeReportInJob(Args _args) { #AOT str reportName = 'aatestReport'; tableid custTableId = tablenum(CustTable); TreeNode reportNode = TreeNode::findNode(#ReportsPath); Report areport; ReportDesign design; ReportAutoDesignSpecs specs; ReportSection section; ReportRun run; ; // Delete the report if it already exists areport = reportNode.AOTfindChild(reportName); if (areport) areport.AOTdelete(); // Build the report areport = reportNode.AOTadd(reportName); areport.query().addDataSource(custTableId); design = areport.addDesign('Design'); specs = design.autoDesignSpecs(); section = specs.addSection(ReportBlockType::Body, custTableId); section.addControl(custTableId, fieldnum(CustTable, AccountNum)); section.addControl(custTableId, fieldnum(CustTable, Name)); // Now the report will not prompt for user input areport.inter

passing variable through form to report in axapta

This is a sample code for passing variable through form to report in axapta public void sumss() { str ss; int tmp; ; //Element.selectMode(Element.control(Control::Sunny_CustMaster_NO));; for (Table1 = Table1_ds.getFirst(true) ? Table1_ds.getFirst(true) : Table1_ds.cursor(); Table1; Table1 = Table1_ds.getnext()) { tmp = Table1.SrNo; } iss = num2str(tmp,2,2,4,2); } call on clicked event of button Args args = new Args(); ; for (Table1_obj1 = Table1_ds.getFirst(true) ? Table1_ds.getFirst(true) : Table1; Table1_obj1; Table1_obj1 = Table1_ds.getNext()) { args.record(Table1_obj1); element.sumss(); args.parm(iss); new MenuFunction(menuitemoutputstr(Traveling_Voucher), MenuItemType::Output).run(args); } super(); Pass to report like this super(); //psum = element.args().record(); // sumss = element.args().parm("acc"); iss = element.args().parm(); element.SumRes(iss); Table12 = element.args

Create user groups in Microsoft dynamics axapta

1. From an Microsoft Dynamics AX client, click Administration > Setup > User groups. 2. On the Groups tab, press CTRL+N to create a new group. 3. Enter an identification in the Group column (required). For example, Fin for Finance or HR for Human Resources. 4. Enter a name in the User group name column (required). For example Finance Department or Human Resources Department. 5. Click the Users tab. 6. Select users in the Remaining users list box and click the left-arrow button (<) to move the selected users into the Selected users list box. All users moved into the Selected users list box are added to the current group. 7. Press CTRL+S to save changes.

Steps to configuring IIS service manager

1. To open IIS Services Manager, click Start > All Programs > Administrative tools > Internet Information Services Manager. 2. In IIS Manager, navigate to the virtual root DynamicsWebService. 3. Click Action > Properties. 4. On the Directory tab, click Create. 5. Select the Application Pool created when you set up the application integration server. For additional information, see Install an application integration server. 6. For Execute permissions, select Scripts only. 7. Set the local path permissions to read by selecting the Read check box in the Local path section. 8. Navigate to Directory Security and clear Anonymous. Select Integrated. 9. On the ASP.NET tab, select ASP Version 2.0. If the ASP.NET tab does not appear, you must uninstall and reinstall ASP.NET in IIS using the following steps: a. Click Start > Run. b. Type cmd. c. In the Command Prompt window, type: cd your-system-directory\Microsoft.NET\Framework\v2.0.50727. and press ENTER.

select All Records Dynamically in axapta

This is sample code to select All Records Dynamically in axapta static void selectAllRecordsRuntimeArgs _args) { firstTable firstTable; DictField dictField; DictTable dictTable; int field; int fieldId; int records; str header, line; ; // Create a new object of type DictTable based on the firstTable dictTable = new DictTable(tablenum(firstTable)); // Loop through the fields on the table. // For each field, store the field-label in the header variable. for (field=1; field <= dictTable.fieldCnt(); field++) { fieldId = dictTable.fieldCnt2Id(field); dictField = new DictField(tablenum(firstTable), fieldId); header += strfmt("%1, ", dictField.label()); } info(strupr(header)); // strupr changes the string to UPPERCASE // Loop through all the records in the firstTable while select firstTable { line = ""; // For each record in the firstTable, loop through all the //fields // and store the value of the field

Steps to Creating a view in axapta

Steps to Creating a view in axapta  1. First, we locate the Views node under the Data Dictionary in the AOT. 2. Right-click on the Views node and select New View. A new view will be created. You can open its properties by right-clicking and selecting Properties. 3. Change the name of the view to firstCust second and give it a label that describes the contents of the view. 4. The views can actually use queries that have already been created as a base for the data selection. This is done in the Properties of the view by choosing the query from the Query property. However, in our example, we will create the view from scratch. 5. Under the Metadata node, right-click on the Data Sources node and select New Data Source 6. Select the newly created data source and enter firstTable in the table property. The name of the data source will automatically change to firstTable_1, which is normal. 7. Under the firstTable data source, find the Data Sources node, right-click on it, and select