Langsung ke konten utama

Postingan

Menampilkan postingan dari 2015

How to Round Up and Round Down Numbers In AX

To round number in AX, we can use 2 method. If we wanna round up, we can use  RoundUp(real value, real unit)  function and we can use  RoundDown(real value, real unit)  function if we wanna round down numbers. For example, we can see the source code of a job below : static void Rounding(Args _args) {     real    temp, roundingUp, roundingDown;     ;     temp = 3000 / 7;     roundingUp = roundUp(temp, 1);     roundingDown = roundDown(temp, 1);     info(strFmt("Origin : %1 RoundingUp : %2 RoundingDown : %3", temp, RoundingUp, roundingDown)); } The result is like a picture below :

Delete indexeddb data by index

var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.msIndexedDB; var IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || { READ_WRITE: "readwrite" };; var db; var transaction, objectStore; var request = indexedDB.open("IndexedDBname", 1);         request.onsuccess = function (evt) {        db = request.result;  var deleteindex = db.transaction(["indexdbtable"], "readwrite") .objectStore("indexdbtable")                 .delete(1); // example if you want to delete index no 1 deleteindex.onsuccess = function(event) { console.log("index 1 deleted" + "indexdbtable");  // log };  };

Function to delete Indexeddb Object(table)

var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.msIndexedDB; var IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || { READ_WRITE: "readwrite" };; var db; var transaction, objectStore; // "IndexDB" is your indexed db name (database) var request = indexedDB.open("IndexDB", 1);         request.onsuccess = function (evt) {         db = request.result; //"indexobject" is your indexdb object (table) transaction = db.transaction("indexobject", "readwrite"); objectStore = transaction.objectStore("indexobject");   // clear all the data out of the object store var objectStoreRequest = objectStore.clear(); objectStoreRequest.onsuccess = function(event) {     // report the success of our clear operation console.log('clear '+"indexobject"); }; };

IndexedDB Fuzzy Search

This is how to create  key range between the search term and the search term with a 'z' letter at the final. db . transaction ([ 'table' ], 'readonly' ) . objectStore ( 'table' ) . openCursor ( IDBKeyRange . bound ( searchTerm , searchTerm + '\uffff' ), // The important part, thank Velmont to point out 'prev' ) . onsuccess = function ( e ) { e || ( e = event ); var cursor = e . target . result ; if ( cursor ) { // console.log(cursor.value.column1 + ' = ' + cursor.value.column2); cursor . continue (); } }; If you need to order the result, so I defined a array before the transaction, then we call it when we loaded all data, like this: var result = []; db . transaction ([ 'table' ], 'readonly' ) . objectStore ( 'table' ) . openCursor ( IDBKeyRange . bound ( searchTerm , searchTerm + '\uffff' ), // The important

Use HTML5 IndexedDB cursors to update existing records

The  HTML5   IndexedDB  is still in the working draft stage and not fully implemented in major Internet browsers yet. Nevertheless, I tried to use its asynchronous API to develop a  Google Maps  application. It took me a little while to figure out how to update an existing record in the IndexedDB  database store. This can be done by opening a read-write cursor to the record to be updated. Then call the cursor  update  method to replace it with the new record. An example Javascript code snippet is shown below. try { var objDb; //the database to update var store = 'myStore' ; //the database store to update var key = 88; //the key of the existing record to update var newRec = 'hello world' ; //the new record var objStore = null ; var objTrans = null ; var objCursor = null ; var objKeyRange = null ;   //...etc...open the database....etc... //open a read-write transaction objTrans = objDb.transaction(store,_IDBTransaction.READ_WRITE);

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