Interview Questions

Tuesday, September 22, 2015

Free text invoice in Dynamics Ax 2012 R3

A common question arises in my mind that such a detail sales order invoiced exists then why we need free text invoice. I found two detail answers with reference
A free text invoice is an invoice that is not attached to a sales order. A free text invoice contains a header and one or more lines for items or services that are not tracked in inventory. Use a free text invoice for sales that do not require a sales order, packing slip, and customer invoice. For example, you can use a free text invoice for a consulting fee or services fee, or for a miscellaneous fee for an event reimbursement.
and
A free text invoice is not related to a sales order. It contains order lines that include ledger accounts, free-text descriptions, and a sales amount that you enter. You cannot enter an item number on this kind of invoice. You must enter the appropriate sales tax information.  Also, the customer balance is posted to the summary account from the posting profile that is used for the free text invoice.
In addition,  a free text invoice line can be used to sell a quantity of any kind of goods, services, or rights – providing unit price and quantity information to the customer. It also helps basic amount calculation, and it helps to better identify and explain charges to customers.
Now if we want to create a free text Invoice and post It. You have to follow this, Currently I am using
Contoso demo data and usmf legal entity.

Account receivable => common=> Free text Invoices => All free text Invoices

FreeTextMenu




Free Text Invoice List page opens

Free Text Invoice List Page

Click on Free text Invoice, following form will open
New Free Text Invoice Create Page
Select the customer
Select Customer
Add invoice lines. And select main account, Sales tax group and Item sales tax group. Update the Unit price.
Line
Now click on post on top menu
Post Menu
Following form will open
Postings

Click on ok button to post it, On successfully posting following form will open.
Posted result

Monday, September 21, 2015

Account number for transaction type Sales order revenue does not exist - AX 2012

Solution: If you've eliminated setup issues relating to the Item's configuration then the next step is to check for incomplete or missing configuration of the Chart of Accounts.
Navigate to: General Ledger > Setup > Chart of Accounts > Configure Account Structures and identify where the Sales Order Revenue Account is defined on this form. More likely than not, you will find that this GL account has not been included in any of the listed account structures. Note that this form is a new feature in AX2012 so it's possible that the configuration hasn't been completed.
What appears to be happening is that Dynamics AX2012 correctly identifies which Revenue Account to use for posting the Sales Invoice but cannot find an appropriate entry on the account structures form for this ledger account. In my opinion, the error message could do with being expanded so that users would be able to pin down the root cause.

Error message when you try to post a sales order invoice or a free text invoice in Microsoft Dynamics AX 4.0: "Account number for transaction type Sales tax does not exist"

Symptoms
When you try to post a sales order invoice or a free text invoice in Microsoft Dynamics AX 4.0, you receive the following error message:
Account number for transaction type Sales tax does not exist.
This problem occurs if the sales order invoice or the free text invoice contains sales tax.
Cause
This problem occurs if one or more of the following conditions are true:
  • No ledger account is specified in the Sales tax payable field of the ledger posting group that the invoice uses.
  • The Use tax setting of a sales tax code of a sales tax group is enabled. However, no ledger account is specified in the Use tax payable field of the ledger posting group that the invoice uses.
Resolution
To resolve this problem, follow these steps:
  1. Click General ledger, expand Setup, expand Sales tax, and then click Ledger posting groups.
  2. Specify a ledger account in the Sales tax payable field of the ledger posting group that the invoice uses. To do this, in the line of the ledger posting group, click the drop-down arrow in the Sales tax payable field, and then click a ledger account.
  3. If the Use tax setting of a sales tax code is enabled, specify a ledger account in the Use tax payable field of the ledger posting group. To do this, in the line of the ledger posting group, click the drop-down arrow in the Use tax payable field, and then click a ledger account.

Creating and starting a production order using X++ on Dynamics AX 2012

01
static void _CreateProductionOrder(Args _args)
02
{
03
    ProdQty         qty     = 100;
04
    ItemId          item    = 'youritemid';
05
 
06
    ProdTable       prodtable;
07
    InventTable     inventTable;
08
    InventDim       inventDim;
09
    ;
10
 
11
    // Initialize InventTable using the item
12
    inventTable = inventTable::find(youritemid);
13
 
14
    // Initialize the base values using the previous initialized inventtable.
15
    prodtable.initValue();
16
    prodtable.initFromInventTable(inventTable);
17
 
18
    prodtable.ItemId                = inventTable.ItemId;
19
    prodtable.DlvDate               = today();
20
    prodtable.QtySched              = qty;
21
    prodtable.RemainInventPhysical  = qty;
22
 
23
    // Initialize InventDim, using again the inventtable (Obrigatory)
24
    inventDim.initFromInventTable(inventTable);
25
 
26
    // Set the active BOM and Route, this in order to create the correspondind BOM lines and coproducts. Also to asign resources
27
    prodtable.BOMId = BOMVersion::findActive(prodtable.ItemId,
28
                                             prodtable.BOMDate,
29
                                             prodtable.QtySched,
30
                                             inventDim).BOMId;
31
 
32
    prodtable.RouteId = RouteVersion::findActive(prodtable.ItemId,
33
                                                 prodtable.BOMDate,
34
                                                 prodtable.QtySched,
35
                                                 inventDim).RouteId;
36
 
37
    // Initialize the BOMVersion
38
    prodtable.initBOMVersion();
39
    // Initialize RouteVersion
40
    prodtable.initRouteVersion();
41
 
42
    //Use ProdTableType class to create the production order
43
    prodtable.type().insert();
44
 
45
 
46
}


The code is fairly simple, it starts with the inventTable, and from there it searches for the BOM version and the route for the production order using the prodtable and the InventDim, with all set we just have to use the type().insert() method so the required InventTrans transactions are also created.
Next let’s see how to start the production order, this is fairly simple too, we will use the following code:
 X++ |  copy code |? 
1
void startProdOrder(args _args)
2
{
3
 ProdTable _prodTable;
4
 
5
 _prodTable = ProdTable::find(YOURPRODUCTIONORDER);
6
 _prodTable.autoUpdate(ProdStatus::StartedUp);
7
}
So first we initialize the production order, next we call the autoUpdate method, and we set the status we want, just take note that even if you can send any enum value as a parameter it won’t work if the order is beyond started.
Hope you like it!