Wednesday 5 February 2014

Creating and posting a ledger voucher in ax 2012

1. Double-check that the getLedgerDimension() method exists in the
DimensionAttributeValueCombination table. If not, create it as described in the first
recipe in this chapter.
2. In the AOT, create a new job named LedgerVoucherPost with the following code:
static void LedgerVoucherPost(Args _args)
{
LedgerVoucher voucher;
LedgerVoucherObject voucherObj;
LedgerVoucherTransObject voucherTrObj1;
LedgerVoucherTransObject voucherTrObj2;
DimensionDynamicAccount ledgerDim;
DimensionDynamicAccount offsetLedgerDim;
CurrencyExchangeHelper currencyExchHelper;
CompanyInfo companyInfo;
ledgerDim =
DimensionAttributeValueCombination::getLedgerDimension(
'110180',
['Department', 'CostCenter', 'ExpensePurpose'],
['OU_2311', 'OU_3568', 'Training']);
offsetLedgerDim =
DimensionAttributeValueCombination::getLedgerDimension(
'170150',
['Department', 'CostCenter', 'ExpensePurpose'],
['OU_2311', 'OU_3568', 'Training']);
voucher = LedgerVoucher::newLedgerPost(DetailSummary::Detail,SysModule::Ledger,'');
voucherObj = LedgerVoucherObject::newVoucher('TEST00001');
companyInfo = CompanyInfo::findDataArea(curext());
currencyExchHelper = CurrencyExchangeHelper::newExchangeDate(
Ledger::primaryLedger(companyInfo.RecId),
voucherObj.parmAccountingDate());
voucher.addVoucher(voucherObj);
voucherTrObj1 =
LedgerVoucherTransObject::newTransactionAmountDefault(
voucherObj,
LedgerPostingType::LedgerJournal,
ledgerDim,
'USD',
1000,
currencyExchHelper);
voucherTrObj2 =
LedgerVoucherTransObject::newTransactionAmountDefault(
voucherObj,
LedgerPostingType::LedgerJournal,
offsetLedgerDim,
'USD',
-1000,
currencyExchHelper);
voucher.addTrans(voucherTrObj1);
voucher.addTrans(voucherTrObj2);
voucher.end();
info(strFmt(
"Voucher '%1' has been posted", voucher.lastVoucher()));
}

3. Run the class to create a new ledger voucher.
4. To check what has been posted, open General Ledger | Inquiries | Voucher
transactions and type in the voucher number used in the code:

5. Click on OK to display the posted voucher:

Saturday 1 February 2014

Install Microsoft Dynamics AX on local system without Domain

First, Go to System Properties > Advanced Tab > Environment Variables > System Variables then click New.
Put "UserDnsDomain" on the Variable name. Put any value on the variable value.
run Registry Editor or regedit. go to
Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ComputerName\ActiveComputerName
put any value on the value data.
Install AX.
Note: After Installing AX, change your ActiveComputerName in the Registry to your default computer name. Use the Computer Name in installing the AOS (computer name before changing the registry.)
then restart.

Creating Bootable Pen Drive Using Windows Command Prompt

Making a pen drive bootable is possible in Windows7 & Windows8 operating system. Formatting a computer to install fresh Windows OS with a CD/DVD drive is not very good because it takes too much time to install fresh Windows operating system. There can also be a problem for many people that CD/DVD drive doesn’t work properly. So this can be a problem for them. Today laptop or desktop comes many USB ports. So there is no need of CD/DVD drive to format a system. Formatting is very fast and easy with flash drive/pen drive and also no software is required for this method. Windows7 or Windows8 command prompt can do the work with few lines of command. Just follow this tutorial.
Start your command prompt.
 For windows7 users:
Go to “Start” button and click. Write “cmd” then cmd icon will appear on the top of the panel. (Fig.1)
Starting Windows CMD
Fig.1-Starting Windows CMD
“Right click” on the cmd icon and click “Run as administrator”(Fig.2)

Running Command Prompt As Administrative
Fig.2-Running Command Prompt As Administrative
It will open the command prompt. (Fig.3)
Windows 7 CMD Window Pops Up
Fig.3-Windows 7 CMD Window Pops Up
For windows 8 users:
Press “Windows key” and press “c”. You will see the command prompt icon. “Right click” on the command prompt icon and click “Run as administrator” from the bottom bar. (Fig.4)
Windows 8 CMD Window Pops Up
Fig.4-Windows 8 CMD Window Pops Up
It will open the command prompt like in Fig.3
Now following steps are same for the windows7 and 8 OS.
Type “diskpart” inside the command prompt and hit “ENTER”(Fig.5)
Type diskpart And Enter
Fig.5-Type diskpart And Enter
It will good before going to next step that you should disconnect all other external hard disk, flash/pen drive etc. because accidently these drive can be formatted. So taking precaution is good. Only one pen drive with minimum 4 GB should be connected. Save all the data from the pen drive because it will be formatted in one of the following step.
After last step type “list disk” inside the command prompt and hit “ENTER”(Fig.6)
Type list Disk And Enter
Fig.6-Type list Disk And Enter
This will show all disk connected to the system like DISK 0, Disk 1, and so on with “Status”, “Size” , “Free” etc.. We can recognize the pen drive with size. Disk 0 will be the system disk in which the windows OS is installed. In this tutorial Disk 1 is the pen drive (3855MB=4GB). This pen drive is going to be a bootable pen drive.
Type “select disk 1” inside the command prompt and hit “ENTER”. It will select the disk 1 (pen drive) for all coming steps. (Fig.7)

Type select Disk 1 And Enter
Fig.7-Type select Disk 1 And Enter
Type “clean” and hit “ENTER”. It will erase all the data from the pen drive. (Fig.8)
Type clean And Enter
Fig.8-Type clean And Enter
Type “create partition primary” and hit “ENTER”. It will create a primary partition in pen drive. (Fig.9)
Type create partition primary And Enter
Fig.9-Type create partition primary And Enter
Type “select partition 1” and hit “ENTER”. It will select the partition created in the last step. (Fig.10)
Type select partition 1 And Enter
Fig.10-Type select partition 1 And Enter
Type “format=fs ntfs quick” and hit “ENTER”. It will format the pen drive quickly with NTFS file type. (Fig.11)
Type format=fs quick And Enter
Fig.11-Type format=fs quick And Enter
Type “active” and hit “ENTER”. It will make partition as active for booting after restarting the computer. If this is step is missed then computer will not boot from the pen drive. (Fig.12)
Type active And Enter
Fig.12-Type active And Enter
Type “exit ” and hit “ENTER” to close the diskpart and close the command prompt window. (Fig.13)

Type exit And Enter
Fig.13-Type exit And Enter
Now the pen drive has become bootable. Now all the files from root of Windows operating system setup DVD or ISO has to copy inside the pen drive root.
So open the Windows setup file from DVD or ISO and copy all file by selecting with “Ctrl+A” and paste it inside the pen drive’s root folder as shown in the figure. (Fig.14)
Copying All Files And Pasting It
Fig.14-Copying All Files And Pasting It
After complete copy, the pen drive will be a bootable for Windows 7 and Windows 8 OS completely. You just need to“Restart” your computer. “Restart” your computer. When BIOS screen appears then press “F12” key. It will show the options to boot from CD/DVD drivehard disk and pen drive. Just scroll down to pen drive and hit “Enter”. Your system will boot from pen drive. Now you can install windows OS.
http://www.wikihow.com/Create-a-Bootable-Windows-7-or-Vista-USB-Drive