public class ReportRun extends ObjectRun
{
ItemGroupId itemGroup;
DialogField dialogItemGroup;
}
public Object dialog(Object _dialog)
{
DialogRunBase dialog;
;
dialog = super(_dialog);
dialog.caption("Inventory");
dialog.addGroup("Item Group");
dialogItemGroup = dialog.addFieldValue(typeid(ItemGroupId),itemGroup,"Item Group");
return dialog;
}
public boolean getFromDialog()
{
;
itemGroup = dialogItemGroup.value();
return true;
}
public boolean fetch()
{
Query q;
QueryRun qr;
QueryBuildDataSource qbds;
QueryBuildRange qbr;
;
q = new Query(this);
qbds = q.dataSourceTable(tablenum(InventTable));
qbr = qbds.addRange(fieldnum(InventTable,ItemGroupId));
qbr.value(itemgroup);
qr = new QueryRun(q);
while( qr.next() )
{
inventTable = qr.get(tablenum(InventTable));
this.send(inventTable);
}
return true;
}
Note: for reference you can check LedgerCheckTrans report
Monday, December 26, 2011
Friday, December 23, 2011
AX in Hindi
Guys this is what AX is in hindi, after running the hindi script in microsoft. I found it funny so sharing with you guys.
Check for empty values inside a query
Suppose we need to check/filter data inside the tabel on the basis of null values, or we need to fetch the data from a table where the value of the field is null.
sysQuery::valueEmptyString for the select query to fetch the data from the table where there is no value for the selected record.
sysQuery::valueNotEmptyString for filtering data where there is value in the field, this will fetch only those records for which there is value.
For example, we can use this inside filter query on datasources of the form, inside the init or execute query methods.
QueryBuildRange QueryBuildRange;
;
QueryBuildRange = this.query().dataSourceTable(tablenum(CustTable)).
addRange(fieldnum(CustTable, AccountNum));
QueryBuildRange.value(sysQuery::valueNotEmptyString());
This will only display non empty records on the form grid.
Reference: http://msdn.microsoft.com/en-us/library/aa866017(v=ax.50).aspx
sysQuery::valueEmptyString for the select query to fetch the data from the table where there is no value for the selected record.
sysQuery::valueNotEmptyString for filtering data where there is value in the field, this will fetch only those records for which there is value.
For example, we can use this inside filter query on datasources of the form, inside the init or execute query methods.
QueryBuildRange QueryBuildRange;
;
QueryBuildRange = this.query().dataSourceTable(tablenum(CustTable)).
addRange(fieldnum(CustTable, AccountNum));
QueryBuildRange.value(sysQuery::valueNotEmptyString());
This will only display non empty records on the form grid.
Reference: http://msdn.microsoft.com/en-us/library/aa866017(v=ax.50).aspx
Thursday, September 22, 2011
Importing data into microsoft dynamics AX
The way one can import data into microsoft dynamics ax from a .dat file is
1. Navigation Pane->administrator-> periodic-> import data
2. then selecting the dat file to capture the data into AX.
3. Once the .dat file is loaded we can make a batch job to update the table or else we can do it manually as well.
But if the data is huge it will take forever to load the data because it does all the validations for each data while uploading it.But there is a fix.
Note: Before following these steps make sure you have your database backed up because this steps overwrite the existing data
->unzip and keep the data into one of the drives(c:)
-> once you have the .dat file then open Microsoft SQL Server Management Studio
-> In the Object explorer window select the database for AX.
-> Right click the database and select Restore Database
-> in Select Page window select General menu
-> On the source for restore, select the radio button From device:
-> By clicking on the browse button to the right of the option , give the path of the .bat file.
-> Your database will get listed at the bottom of the screen
-> Select the Options menu on the Select a Page tab again(near General menu)
->one the page select overwrite existing data check box
-> and click OK
It will take few minutes to load the data directly into the database, once it is complete you can start the AOS services again.
Subscribe to:
Posts (Atom)
