The purpose of this blog is for knowledge sharing and connect the relevant audience who are all into Microsoft Dynamics world.
Alfasith AX
Saturday, November 29, 2014
Wednesday, November 19, 2014
Code to print Ledger journal balance in AX
static void AlfasithPrintLedgerBalance(Args _args)
{
LedgerBalanceMainAccountAmounts balance;
MainAccountListPageBalanceParameters balanceParameters;
MainAccount mainAccount;
;
mainAccount = MainAccount::findByMainAccountId( "11120005");
balanceParameters = MainAccountListPageBalanceParameters::construct();
balance = LedgerBalanceMainAccountAmounts::construct();
balance.parmAccountingDateRange(balanceParameters.getStartDate(),balanceParameters.getEndDate());
balance.parmPostingLayer(balanceParameters.getPostingLayer());
balance.parmIncludeOpeningPeriod(balanceParameters.getIncludeOpeningPeriods());
balance.parmIncludeRegularPeriod(balanceParameters.getIncludeOperatingPeriods());
balance.parmIncludeClosingPeriod(balanceParameters.getIncludeClosingPeriods());
balance.parmIncludeClosingPeriodBySystem(balanceParameters.getIncludeClosingPeriods());
balance.calculateBalance(mainAccount);
info(strFmt("%1", balance.getAccountingCurrencyBalance()));
}
{
LedgerBalanceMainAccountAmounts balance;
MainAccountListPageBalanceParameters balanceParameters;
MainAccount mainAccount;
;
mainAccount = MainAccount::findByMainAccountId( "11120005");
balanceParameters = MainAccountListPageBalanceParameters::construct();
balance = LedgerBalanceMainAccountAmounts::construct();
balance.parmAccountingDateRange(balanceParameters.getStartDate(),balanceParameters.getEndDate());
balance.parmPostingLayer(balanceParameters.getPostingLayer());
balance.parmIncludeOpeningPeriod(balanceParameters.getIncludeOpeningPeriods());
balance.parmIncludeRegularPeriod(balanceParameters.getIncludeOperatingPeriods());
balance.parmIncludeClosingPeriod(balanceParameters.getIncludeClosingPeriods());
balance.parmIncludeClosingPeriodBySystem(balanceParameters.getIncludeClosingPeriods());
balance.calculateBalance(mainAccount);
info(strFmt("%1", balance.getAccountingCurrencyBalance()));
}
Tuesday, November 4, 2014
15 - 40 Minutes full compilation of AX using CMD prompt
Hi,
cd C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin
Here \\MicrosoftDynamicsAX\\ represents the Instance name that you given while installing.
axbuild.exe xppcompileall /aos=01 /altbin="C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin" /workers=4
aos = 01 is the SI NO. you can find that SI for your instance in server configuration.
Reference page : http://msdn.microsoft.com/library/d6da631b-6a9d-42c0-9ffe-26c5bfb488e3.aspx
Regards,
Mohamed Alfasith
cd C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin
Here \\MicrosoftDynamicsAX\\ represents the Instance name that you given while installing.
axbuild.exe xppcompileall /aos=01 /altbin="C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin" /workers=4
aos = 01 is the SI NO. you can find that SI for your instance in server configuration.
Reference page : http://msdn.microsoft.com/library/d6da631b-6a9d-42c0-9ffe-26c5bfb488e3.aspx
Regards,
Mohamed Alfasith
Monday, November 3, 2014
Access the other instance DB belongs to same domain but different DB in AX
Hi,
static void AlfasithOtherDBAccess(Args _args)
{
LoginProperty loginProp;
ODBCConnection conn;
Resultset resultSet, resultSetCount; // get record
Statement statement1, statement2; // Create SQL Statement
ResultSetMetaData metaData ; // get Record metadate like columnname.
RetailTillLayout RetailTillLayout;
int i = 1;
;
// Set Server Database
loginProp = new LoginProperty();
loginProp.setServer('DNWADY0046L'); // System or server name
loginProp.setDatabase('MicrosoftDynamicsAX'); // instance DB name like MicrosoftDynamicsAX_Live
// Create Connection and SQL Statement
conn = new ODBCConnection(loginProp);
statement1 = conn.createStatement();
resultSet = statement1.executeQuery("SELECT TOP 1 * from [MicrosoftDynamicsAX].[dbo].[RetailTillLayout]");
while (resultSet.next())
{
metaData = resultSet.getMetaData();
while (i)
{
info("Column Name :"+metaData.getColumnName(i)+ " Value = "+resultSet.getString(i));
i++;
}
}
}
Regards,
static void AlfasithOtherDBAccess(Args _args)
{
LoginProperty loginProp;
ODBCConnection conn;
Resultset resultSet, resultSetCount; // get record
Statement statement1, statement2; // Create SQL Statement
ResultSetMetaData metaData ; // get Record metadate like columnname.
RetailTillLayout RetailTillLayout;
int i = 1;
;
// Set Server Database
loginProp = new LoginProperty();
loginProp.setServer('DNWADY0046L'); // System or server name
loginProp.setDatabase('MicrosoftDynamicsAX'); // instance DB name like MicrosoftDynamicsAX_Live
// Create Connection and SQL Statement
conn = new ODBCConnection(loginProp);
statement1 = conn.createStatement();
resultSet = statement1.executeQuery("SELECT TOP 1 * from [MicrosoftDynamicsAX].[dbo].[RetailTillLayout]");
while (resultSet.next())
{
metaData = resultSet.getMetaData();
while (i)
{
info("Column Name :"+metaData.getColumnName(i)+ " Value = "+resultSet.getString(i));
i++;
}
}
}
Regards,
Subscribe to:
Posts (Atom)
SQL code to upate one Legal entity banner to all the legal entity in D365
Hi, update companyimage set companyimage.Image = companyimageA.Image from ( select Image from companyimage where dataAreaid = 'USF...
-
Hi, AccountingDistribution ( accounting distribution 7452 ) AccountingDistributionEventTmp ( accounting distribution 100001 ) Accountin...
-
Hi, Create a EDT name it Gender then in properties enumType : //select the enum name Use the below code and enjoy. static v...