Sunday 28 June 2015

ERROR IN INVENTORY RECALCULATION "Account Number for transaction type Inventory, inventory receipt does not exist" - Ax 2012

Hello Guys..!

While doing inventory closing got below error

 "Account Number for transaction type Inventory, inventory receipt does not exist"


Reason :

I have given all accounts in posting profiles , but still same problem. Finally I found that offset ledger dimension value is missing in "InventTransPosting" table.

Solution :

By updating offset ledger dimension value in InventTransPosting Table.

Copy and Paste below code in AOT->Jobs and then run the job.

Note : Change from and todate in the below job according to your requirement

Example : If you are doing inventory closing from 1 JAN 2015 to 28 Feb 2015 .
                 Give same dates in below job.


static void UpdateInventTransPosting(Args _args)
{
    InventTransPosting                      inventTransPosting;
    GeneralJournalEntry                     generalJournalEntry;
    GeneralJournalAccountEntry              generalJournalAccountEntry;
    SubledgerVoucherGeneralJournalEntry     subledgerVoucherGeneralJournalEntry;
    TransDate                               frmDt = mkDate(04,05,2015);// Need to change
    TransDate                               toDt = mkDate(15,05,2015);// Need to change
    ;
    startLengthyOperation();
    ttsBegin;
    while select inventTransPosting where inventTransPosting.TransDate <= frmDt && inventTransPosting.TransDate >= toDt
        && inventTransPosting.OffsetLedgerDimension
        && inventTransPosting.InventTransPostingType == InventTransPostingType::Financial
    {
        select LedgerDimension from generalJournalAccountEntry
        join RecId from generalJournalEntry
        where generalJournalEntry.RecId == generalJournalAccountEntry.GeneralJournalEntry
        && (generalJournalAccountEntry.PostingType == LedgerPostingType::InventLoss || generalJournalAccountEntry.PostingType == LedgerPostingType::InventProfit)
        join RecId from subledgerVoucherGeneralJournalEntry
        where subledgerVoucherGeneralJournalEntry.GeneralJournalEntry == generalJournalEntry.RecId
        && subledgerVoucherGeneralJournalEntry.Voucher == inventTransPosting.Voucher
        && subledgerVoucherGeneralJournalEntry.VoucherDataAreaId == inventTransPosting.dataAreaId
        && subledgerVoucherGeneralJournalEntry.AccountingDate == inventTransPosting.TransDate;
       if (generalJournalAccountEntry.LedgerDimension)
        {
            inventTransPosting.selectForUpdate(true);
            inventTransPosting.OffsetLedgerDimension = generalJournalAccountEntry.LedgerDimension;
            inventTransPosting.doUpdate();
        }
    }
    ttsCommit;
    info('Updation completed');
    endLengthyOperation();
}


That's It...!


@Rahul Talasila

Thursday 25 June 2015

10.00 cannot be picked because only 0.00 is/are available from the inventory - Axapta 2012

Hello Guys..!

while posting product receipt I got below error

“ #### cannot be picked because only 0.00 is/are available from the inventory.”

Reason :

This happens when item quantity is reserved in purchase order line.

Solution :

Step 1 :

Step :2

Make "Reservation" field 0(Zero).




That's it...

@Rahul Talasila

Monday 15 June 2015

Physical updating quantity in the inventory unit PCS must be other than zero - Ax 2012

Hello Guys ..!


Some times we get below error while doing purchase product receipt


"Physical updating quantity in the inventory unit must be other than zero."

Reason 1:

->Through code we updated receivenow qty in purchline but it is not properly updated in other areas.

Reason 2:                                                    
-> In purchline Table RemainInventPhysical , RemainPurchPhysical fields values are zero(0) but through code you are trying to post product receipt.


Solution For Reason 1:

Call "modifiedfield" method after assigning value to "PurchReceivedNow "

Example :


purchLine.PurchReceivedNow = 35.00;// Your Receive Now Qty
purchLine.modifiedField(fieldNum(purchLine, PurchReceivedNow));



Solution For Reason 2:

Update RemainInventPhysical , RemainPurchPhysical in purchline table with Ordered Qty

That's it...


Note : Check purchase line item unit Id conversion is exist or not.

@Rahul Talasila

Short Cuts In Axapta

Hello Guys..!

Here I'm sharing all short cuts in Axapta .

Viewing/Navigation options


 

Accelerator Keys
Task Description
Alt+F1
Show Navigation Pane (if it is not in auto-hide mode)
 
This shortcut works from both MDI & SDI windows, so it is a good shortcut to get back to the main workspace.
Shift+Alt+F1
Enable/Disable auto-hide for the Navigation Pane
Ctrl+Shift+D
Toggles the Content Pane between Developer and Content modes.  Developer mode makes the content frame (where Area pages & List pages are viewed) restorable/minimizable so it is easier to work with developer windows.
Ctrl+F1
Open global search pane
Alt+F5
Toggle the docking status of a docking window
Alt+F6
Move to the next docked window
Alt+Shift+F6
Move to the previous docked window
Ctrl+F6
Move to the next MDI window
Ctrl+Shift+F6
Move to the previous MDI window
Ctrl+Shift+V
Open “Version control parameters” form
Ctrl+W
Open a new workspace
F11
Focus the Address Bar in edit mode (works from anywhere)
Alt+Left Arrow
Shortcut for the Back button on the Address bar
Alt+Right Arrow
Shortcut for the Forward button on the Address bar
From AreaPage, ListPage or developer (MDI) window
 
Alt+M
Show the Microsoft Dynamics AX Command Bar
Alt+W
Show Windows menu
 
Hint: do this then press “a” to close all windows.
Alt+V
Show View menu
Alt+H
Show Help menu
Alt
Show Keytips
 
Press the corresponding key to navigate directly to ActionPaneTab/Group/Button
 
There may be one or more ActionPaneTabs/Groups/Buttons with the same letter for a Keytip.  To execute a duplicate Keytip, keep pressing the letter until focus is on the one you want and then hit Enter.


Accelerator Keys
Task Description
Ctrl+N
Create a new record
Ctrl+S
Save current record
Alt+F9
Delete record(s)
Ctrl+F4
Close the active window (saving changes)
Esc
or
Ctrl+Q
Close the active window (cancelling changes)
Alt+F4
Close the active window from SDI form (saving changes), Close the application from the main window
Ctrl+P
Print auto-report associated with current form
Ctrl+A
Select all rows in the currently active data source (works regardless of whether you are in a grid or not)
Alt+Down Arrow
Drops down a lookup field or drop-down-list
Ctrl+Alt+F4
or
Menu[i] + G
Go to Main Table Form
F10
Activate the form’s menu bar (File, Edit, etc.)
Enter or Tab
Move to the next field
 
Enter will skip over buttons and will move to fields across tabs.
 
Tab will navigate to buttons and will always stay on the same tab page.
Shift+Enter or Shift+Tab
Move to the previous field (same caveats as previous row)
Ctrl+Shift+Home
Go to the first entry field in the form
Ctrl+Shift+End
Go to the last entry field in the form
Ctrl+Page Up
Go to the previous field group
Ctrl+Page Down
Go to the next field group
Shift+F10
Open context menu for current field
Page Up
Move to the previous page of records
Page Down
Move to the next page of records
Ctrl+Home
Move to the first record
Ctrl+End
Move to the last record
F5
Refresh all data sources on the current form
Ctrl+F5
Restore only the active record



Accelerator Keys
Task Description
Ctrl+F
Find by Field (clears previously applied filters)
Ctrl+K
Filter by Field (appends to previously applied filters)
Alt+F3
Filter by Selection
Ctrl+F3
Open Advanced Filter window
Ctrl+Shift+F3
Clear all filters
Within a Grid
 
Ctrl+G
Enable/Disable Filter by Grid
Ctrl+Up Arrow
From a grid cell, move focus to the Filter by Grid input cell for that column (Filter by Grid must be enabled)
On a ListPage
 
Shift+F3
Focus the Quick Filter (“Type to filter” area)
Focus in Quick Filter
 
Enter
Execute/Clear Quick Filter
Down Arrow
Drop down the Quick Filter’s Field Chooser menu

 

Accelerator Keys
Task Description
Ctrl+E
Export to Excel (only contents of grid)
Ctrl+C
Copy:
 
1)      If Single cell is selected, copies just that cell contents
2)      If the entire row is selected or multiple rows are selected, copies values for ALL fields on all the rows (including those off the grid)
Up/Down Arrow
Move focus to the next/previous record, unselecting the current record
Ctrl+Up/Down Arrow
Move focus to the previous/next record, leaving the current record marked and not marking the newly focused record
Shift+Up/Down Arrow
Move focus to the previous/next record, leaving the current record marked and marking the newly focused record
Ctrl+Shift+Home/End
Mark all records between the currently selected record and the first/last record
Editable Grids
 
Shift+Space
Mark the current record, leaving previously marked records marked.
Read-only Grids
(such as on a ListPage)
 
Enter
Execute default action (only on ListPage grids, usually opens the corresponding details form for selected record)
 
For, Non-ListPage forms, Enter will move to the next field
Left Arrow
Move focus one field to the left.  If focus is already in the left-most column, hitting Left Arrow will “mark” the row.
Right Arrow
Move focus one field to the right.
Ctrl+Space
Mark the current record, leaving previously marked records marked.
Shift+Space
Mark all records between the current record and the top-most marked record (or the top record if none are marked), leaving previously marked records marked.
Shift+Page Up/Page Down
Mark all records between the currently selected record and the previous/next page of records.

AOT
 

Accelerator Keys
Task Description
Ctrl+D
Open the AOT
Ctrl+Shift+P
Open the Projects window
Ctrl+ O  or
Menu + O
Context: Description
Job: Execute the job
Class: Run the main(Args) method
Form: Launch the form
Report: Run the report
Table: Launch Table Browser for this table
Menu + W
Open new AOT window, with only the current node
Ctrl+N
Create a new object
Enter
or
Ctrl+Shift+F2
Edit an object
Ctrl+S
Save current object
Ctrl+Shift+S
Save all modified objects
Delete
Delete current object
F2
Rename current object
Menu + R
Restore the state of the current object from disk, cancelling any pending changes
Ctrl+Shift+I
Import one or more application objects from a file
Menu + X
Export the current node to an XPO
F7
Compile
Ctrl+P
Print the active application object (basically XPO contents)
Alt+Enter
Open the property sheet
Ctrl+F
Find window
Ctrl+G
Compare different versions of the application object
Alt+Left Arrow
Move the object to the level of its current parent node in the tree
Alt+Right Arrow
Make the current object a child of the nearest container above it in the tree
Alt+Up Arrow
Move the object one slot up in its current level of the tree
Alt+Down Arrow
Move the object one slot down its current level of the tree
Number Pad *
Expand all sub-trees under this node
Shift+F9
View breakpoints
Ctrl+Shift+F9
Remove all breakpoints
Source Control
 
Alt+I
Check the application object into the version control system
Alt+O
Check out the application object for editing
Alt+U
Undo check out
 

 

Accelerator Keys
Task Description
Ctrl+N
Create a new method/job
Ctrl+S
Save current method/job
F5
Context: Description
Job: Execute the job
Class: Run the main(Args) method
Form: Launch the form
Report: Run the report
Ctrl+F
Find and Replace (Find tab focused)
Ctrl+H
Find and Replace (Replace tab focused)
F3
Repeat the last find
Ctrl+G
Go to the specified line
F4
Go to the next error/warning/task
F9
Insert or remove a breakpoint
Ctrl+F9
Enable or disable a breakpoint
Shift+F9
View breakpoints
Ctrl+Shift+F9
Remove all breakpoints
Ctrl+Space
List properties and methods for the selected object
Ctrl+Alt+Space
Lookup a selected label or text
Ctrl+Shift+Space
Go to the definition of the selected method
F2
List all tables
Ctrl+T
List all Extended Data Types
F11
List all enums
F12
List all classes
Shift+F2
List language-reserved words
Shift+F4
List built-in functions
Alt+R
Open the “Scripts” context menu
F6
Close the current tab discarding all changes since last save
F8
Close, and save the current tab
Ctrl+L
Delete the current line
Ctrl+Shift+L
Delete from cursor to the end of the line
Selection Modes
 
Alt+A
“Select Area” - Area Selection Mode – clicking and selecting an area in the editor occurs as in typical editors (default setting)
Alt+O
“Select Columns” - Block Selection Mode – clicking and selecting an area will do so in a rectangle starting from the initial mouse cursor position (entire lines are not selected)
Alt+L
“Select Lines” - Line Selection Mode – clicking a line will select the entire row, clicking and selecting an area will always select the entire lines.
Alt+U
“Undo Selection” - Unselect the current selection.

Debugger
 

Accelerator Keys
Task Description
F5
Go
Shift+F5
Stop
F11
Step into function calls
F10
Step over function calls
Ctrl+F11
Step out of the function
Ctrl+F10
Run to cursor
Ctrl+Shift+F10
Set next statement
Alt+Number Pad *
Show next statement
Shift+F9
View breakpoints
F9
Insert or remove a breakpoint
Ctrl+F9
Enable or disable a breakpoint
Ctrl+Shift+F9
Remove all breakpoints
Ctrl+Alt+Line
Show/hide line numbers
Ctrl+Alt+V
View variables
Ctrl+Alt+C
Display the call stack
Ctrl+Alt+O
View output
Ctrl+Alt+B
View breakpoints
Ctrl+Alt+W
View watch
Ctrl+Alt+M
Toggle workbook mode
Ctrl+Alt+D
Restore default layout
Ctrl+F4
Close window
Ctrl+Shift+F4
Close all windows
Ctrl+F6
Next window
Ctrl+Shift+F6
Previous window
During code execution
 
Ctrl+Break
Break execution of currently running script.
 
To open the debugger where the execution is stopped, when the “Are you sure that you want to cancel this operation?” dialog comes up, hold SHIFT and click the No button.

 
@Rahul Talasila

Adding a newline into a string in C# and X++

Below is the sample code we can use for  adding a newline after every occurrence of "@" symbol in the string in C#   using System...