Langsung ke konten utama

Postingan

How to enable mixed authentication in sql server

On the SQL Server start  SQL Server Management Studio   Enter the  Server name  and select  Windows authentication . Make sure you are logged in with administrator credentials.   Right click on the server name and select  properties   Go to  Security  and select  SQL Server and Windows Authentication Mode .   Right click on the server name and select  Restart  to restart the SQL services.

Create Quick first SSRS report in Dynamics AX 2012

Today, let us learn how to quickly create report models and report in Visual studio and add to AOT[Dynamics AX 2012] and see a running report. Some information: SQL Server Reporting Services is the primary reporting platform for Microsoft Dynamics AX. Reporting Services is a server-based reporting platform that includes a complete set of tools to create, manage, and deliver reports, and APIs that enable you to integrate or extend data and report processing in custom applications. Reporting Services tools work within the Microsoft Visual Studio environment and are fully integrated with SQL Server tools and components. In a Visual Studio reporting project for Microsoft Dynamics AX, you can define a report in a report model. A report consists of a collection of items, such as datasets, parameters, images, and report designs. A model can contain more than one report. Also, for this post I am assuming that all report services are configured in the system. Let us create a query in...

Example export data to excel in AX 2012

Example export data to excel in AX 2012 void exportToExcel() {     SysExcelApplication application;     SysExcelWorkBooks workbooks;     SysExcelWorkBook workbook;     SysExcelWorksheets worksheets;     sysExcelWorksheet worksheet;     SysExcelCells cells;     SysExcelCell cell;     int row;     ;     application = SysExcelApplication::construct();     workbooks = application.workbooks();     //gets the workbook object     workbook = workbooks.add();     // creates a new workbook     worksheets = workbook.worksheets();     //gets the worksheets object     worksheet = worksheets.itemFromNum(1);     //Selects the first worksheet in the workbook to insert data     cells = worksheet.cells();     cells.range('A:A').numberFormat('@'); // numberFormat ‘@’ is to insert data ...

How to filter records in a form by code

The standard filter functionality in Ax forms is a neat and powerful feature. Using this filter functionality in your code is something you'll definitely use at some point in time as a programmer. Although it's possible to do it in a single line of code, I prefer a 3 step solution. That way it's more flexible. Let me show you by example. We'll filter the customers records in form CustTable, only showing customers with currency USD. Step 1:  Declare a class variable In the  ClassDeclaration  method of the form, define a range. QueryBuildRange CurrencyQBR; Step 2:  Instantiate the new range. In the  init  method on the datasource of the form, you assign the range to a specific field (after the super call). public void init() { super(); CurrencyQBR = this.query().dataSourceName('CustTable').addRange(fieldnum(CustTable,Currency)); } Step 3:  In the last step, you assign a value to the range. This is done in the  executeQuery  meth...

Error: An Unbalanced X++ TTSBEGIN/TTSCOMMIT pair has been detected... In AX

Error:  When trying to create a new record(s) in any table system shows following error eg. At the time of creating new Sales Order and this error may appear. Possible Reason(s): TTS level '1' usually leaves your Ax session in an unusable state that you can't close properly. Check all code for form or class from where this error comes and count the ttsbegin and ttscommit there must be same like if u write 2 ttsbegin u must have to write 2 ttscommit. Solution: To resolve this error this TTS level should be ZERO, Run this job to get rid of that error, this job will find the tts level where its greater than zero and make it zero by calling TTSABORT. static void TheAxaptaResetTTS(Args _args) {     while (appl.ttsLevel() > 0)     {         info(strfmt("Level %1 aborted",appl.ttsLevel()));         ttsAbort;     } } Other Info: ttsBegin : mar...

Get the filename from the File Path using X++

AX has a standard method in the Global Class to split the file name from the entire file path.The method is fileNameSplit().The method takes filepath as the parameter.It splits the filepath into three different strings filepath,filename,fileextension respectively.The usage of the function can be seen below. Filename filepath;  Filename filename;  Filename fileType;  str fileNameString; ; [filepath, filename, fileType] = fileNameSplit(fileNamePath);  fileNameString= filename + fileType;  Now the fileNameString will return you the filename with extension.

File open dialog on AX 2012 form

Problem: I want to show a file open dialog on AX 2012 form but when I click the open dialog button it doesn't respond. Solution: On Runbase OR Sys operations framework, all you have to do is set the EDT to FileNameOpen and dialog will appear, however, on AX form only setting the EDT will not do. You will need to add following methods to your form methods node. str filenameLookupFileName() {     return ""; } FilenameFilter filenameLookupFilter() {     return ["@SYS134052", #AllFilesName+#AllFilesExt]; } str filenameLookupInitialPath() {     return ""; } str filenameLookupTitle() {     return "Select a trade agreement to import"; }