Dynamics AX
  RSS Feed  LinkedIn  Twitter
Want to turn you're data into a true asset? Ready to break free from the report factory?
Ready to gain true insights that are action focused for truly data informed decisions?
Want to do all of this across mutliple companies, instances of Dynamics and your other investments?
Hillstar Business Intelligence is the answer then! (www.HillstarBI.com)

Hillstar Business Intelligence for Microsoft Dynamics AX and NAV on Mobile, Desktop, Tablet


Let us prove to you how we can take the complexity out of the schema and truly enable users to answer the needed questions to run your business! Visit Hillstar Business Solutions at: www.HillstarBI.com

Friday, February 10, 2012

AX 2012 - xppSource Exposed: Inserting code snippets





Today, a peer of mine and fellow blogger Palle Agermark wrote a very interesting post, in which he reviews the new ability in AX 2012 X++, in which certain keywords, while coding, can have code snippets added. The purpose is to decrease the amount of typing needed to complete some code block.

His example shows that if switch is entered into the X++ editor and right after, you hit the Tab key, a code block similar to the following screen shot is automatically added for you.



This is pretty handy, and you can see that it places the cursor right to the next point in the code block in which you would want to start completing it. Palle finishes his post off, with the fact that in visual studio, you can add your own, but was not sure how to do this in AX 2012?

Well, let me explain, how this can be done! The secret to this, is contained within a little known AX 2012 class, called: xppSource



Here we see that we have our cases in which xppSource completion through the use of such code snippets is fired, and also, where you could possibly change this, and / or add your own.

For example, lets change the switch method, within the xppSource class, so that we see really easily that we can make use of this. As you can see below, I've added "IDB" to the first case, in the code snippet block.



In saving this, and compiling it, I went back to my previous method, that we see the output from the first screen shot in this post, and performed the switch + tab action. In doing so we now get what you see below.



That's it! For sure the tag line powerfully simple shows in such a neat little find, which shows giving the ability and flexibility of AX 2012, even for developer needs.

I would like to thank Palle Agermark for the challenge and post, as I think other might find this very useful and helpful. Till Next Time!

Follow Me @:
RSS Feed  LinkedIn  Twitter

"Visit the Dynamics AX Community Page today!"

Labels: , , , , , , , , ,

1 Comments:

Blogger Joris de Gruyter said...

I've posted a specific example of how to add a template method for "find" on tables.
Check out the Code Snippets article on DAXMusings.

2:31 PM  

Post a Comment

Links to this post:

Create a Link

<< Home


Copyright 2005-2011, J. Brandon George - All rights Reserved