Monday, 13 November 2017

shortcuts of Ax2012

Breakpoints
Command
Shortcut key
Remove all breakpoints.
CTRL+SHIFT+F9
Insert or remove a breakpoint.
F9
Enable or disable a breakpoint.
CTRL+F9
Open the Breakpoints dialog.
SHIFT+F9

Compilation and Help
Command
Shortcut key
Open the Scripts menu.
Scripts icon
Open Help.
F1
Show method parameter help.
CTRL+SHIFT+SPACEBAR
Execute the current job.
F5
Compile.
F7
Compile and close a method.
F8
Stop method execution (break).
CTRL+BREAK
Insert a file.
CTRL+ALT+H

Delete
Command
Shortcut key
Delete from the cursor to the end of the line.
Use SHIFT+END to select to end of line and then DELETE
Delete word to the right of the cursor.
CTRL+DELETE
Delete the word to the left of the cursor.
CTRL+BACKSPACE
Delete the current line.
CTRL+X (with cursor in line, no selection)

Edit
Command
Shortcut key
Insert script.
<SCRIPT NAME>
Insert document header.
///
Comment selection.
CTRL+E, C
Uncomment selection.
CTRL+E, U
Convert selection to lowercase.
CTRL+SHIFT+U
Convert selection to uppercase.
CTRL+U
Display all methods and properties for a selected class.
CTRL+SPACEBAR
Copy selection.
CTRL+C (with text selected)
Copy line.
CTRL+C (with cursor in line, no selection

Find and Replace
Command
Shortcut key
Open the Find dialog.
CTRL+F
Open the Replace dialog.
CTRL+R
Start incremental search..
CTRL+I
Move to next incremental search match in method.
CTRL+I
Reverse the incremental search direction.
CTRL+Shift+I
Remove a character from the incremental search string.
BACKSPACE
Stop the incremental search.
ESC

Go To
Command
Shortcut key
Go to a specific line.
CTRL+G
Go to the next page.
PAGE UP
Go to the previous page.
PAGE DOWN
Go to the top of the code.
CTRL+HOME
Go to the bottom of the code.
CTRL+END
Go to the start of line.
HOME
Go to the end of line.
END
Move one word to the left.
CTRL+LEFT ARROW
Move one word to the right.
CTRL+RIGHT ARROW
Go to the method definition.
F12
Go to the next error message.
F4

Lookup
Command
Shortcut key
Look up a label.
CTRL+ALT+SPACEBAR
Show label text.
CTRL+L
Look up a definition.
F12
Show the syntax of a method or property.
CTRL+SPACEBAR

Save
Command
Shortcut key
Save the selected text to a separate file.
ALT+S
Close the current TAB, discarding all changes since the last save.
F6
Close and save the current code editor window.
F8
Close the current window.
CTRL+F4

Select
Command
Shortcut key
Select all.
CTRL+A
Cancel a selection.
ESC
Select columns.
ALT+MOUSE SELECT
Select a line.
ALT+L
Select one word to the left.
CTRL+SHIFT+LEFT ARROW
Select one word to the right.
CTRL+SHIFT+RIGHT ARROW
Select text from the cursor to the start of the line.
SHIFT+HOME
Select text from the cursor to the end of the line.
SHIFT+END
Select the previous page.
SHIFT+PAGE UP
Select the next page.
SHIFT+PAGE DOWN
Select text from the cursor to the top of the code.
CTRL+SHIFT+HOME
Select text from the cursor to the bottom of the code.
CTRL+SHIFT+END
Indent the selected text.
TAB
Remove indentation.
SHIFT+TAB
Select area/column/block
ALT+MOUSE SELECT
Cancel selection
ESC
Show white space
CTRL+SHIFT+S

Undo and Redo
Command
Shortcut key
Undo the last action.
CTRL+Z (previous ten actions)
Redo the last action after an Undo.
CTRL+Y (previous ten actions)

AOT
Command
Shortcut key
Open the AOT
CTRL+D
Open a new Development Workspace
CTRL+SHIFT+W
Open a new Application Workspace
CTRL+W
Save all
CTRL+SHIFT+S
Select all application objects in a node
Select one or more application objects under a top-level node, and then press CTRL+A
Open the editor for an application object
CTRL+SHIFT+F2
Open the editor for a query or table
CTRL+O
Open the Comparison tool
Select one or more application objects, and then press CTRL+G
Compile an application object
F7
Go to the previous node
UP ARROW
Go to the next node
DOWN ARROW
Move the node up
ALT+UP ARROW
Move the node down
ALT+DOWN ARROW
Expand the current node
RIGHT ARROW
Collapse the current node
LEFT ARROW
Select multiple items
CTRL
Cancel the selection of an additional item
CTRL+SPACEBAR
Open the Properties sheet
ALT+ENTER
Open the Import dialog box
Select one or more application objects, and then press CTRL+SHIFT+I
Open the Find dialog box to find an element in the AOT
CTRL+F
Open the Help documentation for an element in the AOT
F1


Developing a custom DIXF entity in Microsoft Dynamics AX 2012

Go to Data Import Export Framework module and click on “Create a custom entity for data import/export” in the Common section.
001
A new wizard will open. Click next.
002
In the next screen you will be asked to choose a table for which the DIXF entity needs to be created.
003
In our case we selected VendBankAccount.
004
In the next screen the Entity Table Name, Entity Query Name, Entity Class Name will be automatically filled. You will need to select the Display menu item name based on the entity you selected and click next.
005
Select the fields you need. You can mark them to select some of the fields or click on Enable All to select all the fields and click next. 006
Click finish to complete the wizard.
007
After some time of processing AX will automatically create a Private Project which will contain all the objects related to your custom DIXF entity.
008
NOTE: You have to ensure your DMFstaging table has a primary index including the fields DefinitionId, ExecutionId and the primary key of the target table.
Also check if the DMF staging table has a relation with the target table on your primary field. This might be your problem.
Check e.g. the relations on an existing DMF staging table.
Go to Target Entities Form. Click new and select the new custom entity from the lookup.
009
Give the Entity name and click save. 010
You custom DIXF entity has been created.
011

Wednesday, 8 November 2017

How to Send Email Notification Of Workflow

Let’s enlarge some more features of AX Workflow. Dynamics Ax2012 facilitates the powerful Email  mechanism which can be used commonly across the modules for new implementations. Especially to fulfill the users wish on getting notification through emails and helping them in their daily activities. 

Scenario:
Edward is an accounting manager and who is not involved in PR approvals as he is occupied by other responsibilities but still he wants to be notified whenever a purchase requisition is approved.

To achieve this follow the below process:

Setup an email address for a user who wishes to receive email.
Navigate to System Administration -> Common -> Users->Select the desired user ->Click on Options.
Enter users email id.




Click ‘Notifications’ and then check the box next to ‘Send notifications in email



Set up AX E-mail Parameters to use the SMTP server
Navigate to System Administration -> Setup -> System -> E-mail Parameters ->Enter details about mail server.


Create an email template navigate to Organization Administration -> Setup -> E-mail Templates ->
Check the checkbox "Show system emails".



Assign your email template to the specific workflow, Navigate to the desired workflow click on basic settings and select the created email template under “email template for workflow notification”


Select the desired notifications on the specific task.


Setup the batch job to distribute the email messages, System Administration -> Periodic -> E-mail Processing -> Batch




Thus by doing this configuration whenever a PR is approved Edward will receive an email notification.

To get the list of Roles assigned to users in AX 2012

we can fetch the required data from Two tables with the help of a small job.
Tables :  SecurityRole & SecurityUserRole



static void SecurityRole(Args _args)
{
  SecurityRole          securityRole;
  SecurityUserRole     securityUserRole;
  
    while select RecId,name from securityRole   
    join securityUserRole   
    where securityRole.RecId == SecurityUserRole.SecurityRole   
    //&& SecurityUserRole.User == curUserId() //for current user roles
    {
      info(strFmt("%1 - %2",SecurityUserRole.User,securityRole.name));
    }
}

8 Common Errors in Dual-write

502 Bad Gateway : when the target application is not ready to handle the incoming request  401 Unauthorized / 403 Forbidden: This error occ...