Wednesday, April 3, 2013

T-SQL 2012: CHOOSE and IIF

 

SQL_Server_2012_logo-56bc115f-4767-4e07-b243-cd61cdf89f84

We’ve been needing these two features for a long time. This post includes a couple of easy examples showing how these functions work.

CHOOSE

I’ll start with CHOOSE. By using CHOOSE you can do away with many tedious CASE statements. CASE statement opportunities are everywhere in Dynamics GP. For instance, how many times have you needed to display the document type in your report and want a word, not a number. Prior to SQL 2012, we would have written a CASE statement that would look a lot like this:

Case SOPTYPE
    when 1 then 'Quote'
    when 2 then 'Order'
    when 3 then 'Invoice'
    when 4 then 'Return'
    when 5 then 'Back Order'
    when 6 then 'Fulfillment Order'
    ELSE 'Undefined Document Type'
End as ' Doc Type'

CHOOSE will pick the value in your list according to the value of your data. It returns the expression at a specific index. So, instead of writing a case statement, you can simply write this:

CHOOSE (SOPTYPE, 'Quote', 'Order', 'Invoice', 'Return',
'Back Order', 'Fulfillment Order') AS DocType

If the value of your index is greater than the number choices, it will return NULL. It will also return NULL if the value is less than 1.

IIF

Next is IIF. Most of you probably already know how to use this and have wondered why you couldn’t do it in T-SQL. Flavors of this are in Excel formulas, Access calculations and even VBA, to name a few. It works with a Boolean expression and returns a value based on whether the expression is true or false. You set this up with three parameters. The first parameter is the expression you’re evaluating, the second parameter is the value if the expression is true, and the third parameter is the value if the expression is false. Yep, just like Excel.

So here’s what it looks like:

IIF(boolean_expression), value if true, value if false)

So much easier than CASE.

Until next post!

Leslie

T-SQL 2012: LAG & LEAD

I’ve just started playing with SQL 2012 and wanted to show you the new LAG and LEAD features.

I’ll use the report below as an example. Suppose you needed to generate a report that showed the last three years of sales. The result set would need to look something like this:

Lag and Lead

LEAD looks ahead the specified number of rows from the current row, and LAG (you guessed it!) looks behind the specified number of rows from the current row. By using the OVER clause you can specify your grouping (partitioning) and sort order.

Using SQL 2012 you can easily accomplish this using the following SELECT statement:

SELECT
   year(docdate)  AS ‘Order Year’
  ,SUM(SubTotal) AS ‘Current Yr Sales’
  ,LAG(SUM(SubTotal), 1, 0) OVER (ORDER BY YEAR(docdate)) AS ‘Last Year Sales’
  ,LAG(SUM(SubTotal), 2, 0) OVER (ORDER BY YEAR(docdate)) AS ‘Year Before Last’
  ,LAG(SUM(SubTotal), 3, 0) OVER (ORDER BY YEAR(docdate)) AS ‘Three Years Ago’
  ,LEAD(SUM(SubTotal), 1, 0) OVER (ORDER BY YEAR(docdate)) AS ‘Next Year’
FROM SOP30200
GROUP BY YEAR(DOCDATE)
ORDER BY YEAR(DOCDATE);

Have fun with it!

Until next post!

Leslie

Monday, April 1, 2013

Dexterity Training in Dallas (June 17 – 21, 2013)

 

Looking for Dexterity training? Come to Dallas!

We’re running this class if only a single person signs up, no cancellations here in Dallas Smile.

I will be teaching the Dexterity Basics class in Dallas, Texas from June 17th to June 21st, providing the basic foundations any Dexterity programmer must have.

This is an opportunity for all of you VSTools programmers to learn how to build your user interface in Dexterity instead of WinForms so that your application will run with the new GP 2013 Web Client. Your existing code will hook right up to the Dexterity events, you may even like the Dexterity forms designer better than VS Tools!

Dexterity is easy to learn and easy to maintain.

For you VBA enhancers, you will learn how to write Dexterity code to deliver your solution instead of VBA. While VBA works marvelously with the rich client, it will not work for the new GP 2013 Web Client. Come to Dallas and learn how easy Dexterity really is.

Even you Technical Consultants, taking the basic Dex class with provide you with the tools you need to understand what all of those error messages really mean. You can become better consultants by learning just how this engine works! (and it’s easy).

For more information, send an email to training@conexussg.com or call 469-828-3274.

Hope to see you in Dallas!

Leslie

The basics class covers the following topics:

Dexterity I – Product Fundamentals

Synopsis:
Dexterity Product Fundamentals will teach you about the development environment used to build the Microsoft Dynamics GP family of products. This course will provide you with the foundation you need to build integrated, database-independent applications. In addition, you will learn how to provide powerful application functionality for Microsoft Dynamics GP.
By actively participating in these classes, you should learn:

Basic programming techniques used by Microsoft Dynamics GP to develop their core modules.

  • How to modify existing Dynamics GP forms and reports in order to make customizations for customers.
  • How to develop add-on applications that will interact with the Dynamics GP products to meet specific requests by customers.
  • How to package and ship your dictionary allowing Microsoft Dynamics GP to make updates to Dynamics GP without affecting the developer’s dictionary.
  • How to register your product with Microsoft Dynamics GP using a unique Product ID to ensure no duplication of add-on applications with the same name.
  • How to develop add-on applications that will “look and feel” like Dynamics GP and provide seamless interface between the applications to ensure a professional finished product.
  • How to use object triggers, which are scripts in your applications that are invoked by events in Dynamics GP, allowing several developers to deliver enhancements to the same Dynamics GP form.

Thursday, March 21, 2013

Kofi Annan Convergence 2013 Keynote Speaker

 

 We had the honor of hearing the wisdom of Kofi Annan as the keynote speaker on the Las day of Convergence. Here is a little more information about this Nobel Peace Prize awarded. 


 


Kofi Annan

The Nobel Peace Prize 2001 was awarded jointly to United Nations (U.N.) and Kofi Annan "for their work for a better organized and more peaceful world"

Photos: Copyright © The Nobel Foundation

 
 

MLA style: "The Nobel Peace Prize 2001". Nobelprize.org. 21 Mar 2013 http://www.nobelprize.org/nobel_prizes/peace/laureates/2001/


Biography

Kofi A. Annan of Ghana, the seventh Secretary-General of the United Nations, is the first to be elected from the ranks of UN staff. His first five-year term began on 1 January 1997 and, following his subsequent re-appointment by the UN Member States, he will begin a second five-year term on 1 January 2002.

MLA style: "Kofi Annan - Biography". Nobelprize.org. 21 Mar 2013 http://www.nobelprize.org/nobel_prizes/peace/laureates/2001/annan.html


He is truly a remarkable man.


Until next post.

Leslie

Wednesday, March 20, 2013

Volunteer Day at Convergence 2013

Sheila-Jefferson Ross participated in the volunteer project and gave me these great pictures.

Thanks Sheila! Keep up the good work.

Until next post!

Leslie

David Musgrave, we miss you!

After the opening session of Convergence 2013 on 3/19/2013 we got together to send a picture message to David Musgrave.
David we Miss you
Sheila Jefferson-Ross, Mariano Gomez and his wife, Leslie Vail and Beat Bucher. Looks like Mariano and his wife are showing off some TimTams and Chicos. I think I’ve been dissed Smile.
Until next post!
Leslie

Sunday, March 17, 2013

Convergence 2013 Day Zero

I got in last night and started the party on Bourbon Street. Here are some pictures of the festivities with Sheila Jefferson-Ross at Acme Oyster on Iberville in the edge of the French Quarter.

Here are some pictures from Bourbon Street and the Acme Oyster Company restaurant:

Until next post!

Leslie

MVP Conference 2013

MVP_FullColor_ForScreen

We had 4 Dynamics GP MVPs at this year’s MVP Conference! John Lowther, Mark Polino, Belinda Adam, and me!

Here are some photos from the conference. I can’t tell you anything we learned there because, as they remind us hourly, everything is subject to the Nondisclosure Agreement we all signed.

Until next post!

Leslie

Get your Convergence 2013 Event App!

Heres HOW!

The full post regarding the app is available here on Donna Edward’s blog:

http://edwardsdna.wordpress.com/2013/03/14/convergence-2013-the-virtual-engagement/

Great post, Donna!

Mobile

We know that when you’re at the event, you’re on the go! Our Convergence mobile option will provide you with a handful of useful information so that you can keep moving in the right direction.

Download the Convergence Event App

Download Instructions: We have three convenient ways to download the apps to your devices.

  1. From your phone: scan this tag to be taken directly to a download for your device.
  2. From your PC or phone: Link directly to your app store.

    Android  Apple iOS  Windows PC (v 8 only), Surface (RT) and Windows Phone

  3. Search for 'Convergence' in your app store.

After downloading the event application, you can use your registration username and password or Microsoft Account to access the following features:

  • Session Schedule and Details – A full catalog of sessions and key events will be available on the fly. View and modify your schedule via Schedule Builder, see 'What's On Now', add new sessions, download session materials, take and share notes and complete evals from anywhere.
  • Social Media and Photo Sharing - Our Twitter feed (#conv13), Facebook Event Page and LinkedIn Group are all accessible from within the app, along with a photo-sharing tool so you can take and upload photos from the event.
  • Contact Exchange – Use the mobile app to scan badges and quickly connect with attendees, speakers, exhibitors and sponsors.
  • Maps and Info – Built in venue and city based guides will help you find their way around, including an interactive map of the expo hall and an entertainment guide for New Orleans.
  • Gaming – Get to the top of the Explore Convergence leaderboard with the most points received for completing various activities within the event - such as networking, sharing photos, posting to social media, completing evaluations and attending sessions.

Don't see your device? Don't worry! We have also created a mobile optimized version of the Convergence website. Login in with your registration username and password or Microsoft account and see a customized view of your event experience, with many of the same features from our mobile app - right at your fingertips!

“The Social Experience:” Elevating Social Media at Microsoft’s Convergence 2013

Read this blog by Jon Rivers and get Social at Convergence 2013!!

Wednesday, March 13, 2013 at 7:15 am
By Jon Rivers

CONV13

Hot Off the Press… Microsoft is looking to elevate the role of social media before, during and after Convergence 2013. To do this, they have created a new space within the Conference, “The Social Experience,” located on the outer edge of the expo hall, near the registration area. You can expect to see a 6’x3’ media wall displaying the Live Wall, which will be showing sponsor content, customer videos and event announcements. I’ve heard they will be also broadcasting the keynote and select general sessions to this wall, live.

“The Social Experience” will also include casual seating so that people can sit down and connect as with the Social Media Command Center. Again, I’ve heard this will be a high-profile, dedicated workspace for Microsoft’s social media team and will include 5 flat screen monitors to track social media activity by ERP platform. You can consider this as a ‘safe landing’ in a crazy event environment, with the ability to charge your laptops and tablets, work, relax, as well as check out the Media Wall.

Now to the other exciting news… I’ve been asked, along with 11 other high-profile social media members at large, to be an official blogger for Convergence 2013. To top off this opportunity, Microsoft has offered to supply the bloggers with Surfaces during this event (so no need to carry heavy laptops…. Yippee!) to help with the convenience of their social media activities.

Before you head out to New Orleans, make sure to plug in the following bloggers into your RSS feeds and add them to your Twitter account so you can hear what’s happening live during Convergence 2013!

Blogger
Product
Handle
Blog

Gus Gonzalez
CRM
@GusGonzalez2
http://www.zero2ten.com/blog/author/gus-gonzalez/

Mark Polino
GP
@mpolino
http://msdynamicsgp.blogspot.com/

Donna Edwards
CRM
@edwardsdna
http://edwardsdna.wordpress.com

Belinda Allen
GP
@belindathegpcsi
www.belindathegpcsi.com

Brandon George
AX
@DynamicsERP
http://dynamics-ax.blogspot.com

Chris Cognetta
CRM
@ccognetta
www.cognettacloud.com

Leslie Vail
GP
@Leslie_Vail
http://dynamicsconfessions.blogspot.com/

Joris de Gruyter
AX
@jorisdg
http://daxmusings.codecrib.com/

Mike Snyder
CRM
@miketsnyder
http://blog.sonomapartners.com/

Joel Lindstrom
CRM
@JoelLindstrom
http://joellindstrom.com/

Jon Rivers
AX/GP/NAV
@jon_rivers; @datamasons
http://www.datamasons.com/blog/

Kerry Rosvold
NAV
@krosvold
http://dynamicsnavfinancials.com/

Fire Inside at Convergence 2013

I got here yesterday and the talk about the conferences is buzzing everywhere, even among all of the parades and parties! Check in starts today, as well as ‘Pre-Game’ with GPPC (GP Partner Connection). If you’re here, get up and get registered!

Don’t forget about this neat opportunity at Convergence:

https://mbs.microsoft.com/partnersource/newsevents/events/conferences/FireInsideatConvergence.htm

Here’s the text of the link:

Last Modified 2/28/2013
Posted 2/27/2013

Coming to Convergence?

Don’t miss the opportunity to reveal your true potential and experience the fun-filled activities at the Change Agent Headquarters. Discover your hero title. Take professional headshot photos. Create your own ad, and meet our LinkedIn specialists who can help bolster your LinkedIn profile to achieve the maximum impact.

Change Agent Headquarters

  • LinkedIn Name Tag Analyzer: Access the app to receive a “Hero Title"
  • DIY ad and Professional headshot
    • Star in your own ad featuring your industry background and new title, and take a professional headshot
    • Use retrieval code/ MSTag to retrieve and share your photo via social media
  • LinkedIn Consultants
    • Meet 2 LinkedIn Consultants who are there to help bolster your professional profiles

  • Roaming Change Agent Ambassadors

    • Engage attendee to help customize hero titles on nametag buttons, and drive additional traffic to the Change Agent HQ

Premium Distribution

  • Name Tag laptop stickers in each messenger bag and at HQ
  • Buttons to be distributed by the Change Agent Ambassador throughout convention hall
  • T-shirts as an Evaluation Prize

Banners

  • 2 large banners featuring 6 ads in the main Lobby

Social Media Integration

  • Feature DIY ads on Digital Social Wall and hash-tag them for twitter search during and post event
  • DIY ads also available for attendees to download and share out on their own

Friday, February 1, 2013

Posting multiple batches with a macro

In a recent forum post, a GP user wanted to use a macro to post multiple batches using the Purchasing Batch Entry window. Sounds easy enough, but wait!

The macro worked fine for posting a single batch, but when the second batch was added, the macro always failed. The reason for the failure is that a Progress window pops up each time you post a Purchasing Batch. The Progress window is shown below:

progress window

In order to solve this problem, you need to account for the opening of this window in your macro. When you record a macro during posting, the macro system does not record it correctly. Below is a comparison of the right way and the way the macro system records it.

The RIGHT way:
NewActiveWin dictionary 'default'  form 'Progress_Control' window 'Progress_Window'

The WRONG way:
ActivateWindow dictionary 'default'  form 'Progress_Control' window 'Progress_Window'

The complete macro to post two batches in a row is below.

Until next post!
 
Here’s the macro.

Each command should be on a single line, it should not wrap.

CommandExec dictionary 'default' form 'Command_Purchasing' command 'POP_Batch_Entry'
NewActiveWin dictionary 'default' form 'POP_Batch_Entry' window 'POP_Batch_Entry'


#!BATCH POSTING 1

NewActiveWin dictionary 'default' form 'POP_Batch_Entry' window 'POP_Batch_Entry'
ActivateWindow dictionary 'default' form 'POP_Batch_Entry' window 'POP_Batch_Entry'
TypeTo field 'Batch Number' , 'BATCH_NUMBER_1'
  MoveTo field Origin item 0
  ClickHit field Origin item 1 # 'Receivings Trx Entry'
MoveTo field 'Batch Comment'
  MoveTo field 'Post Button'
  ClickHit field 'Post Button'
NewActiveWin dictionary 'default'  form 'Progress_Control' window 'Progress_Window'
NewActiveWin dictionary 'default'  form 'POP_Batch_Entry' window 'POP_Batch_Entry'


#!BATCH POSTING 2

TypeTo field 'Batch Number' , 'BATCH_NUMBER_2'
  MoveTo field Origin item 0
  ClickHit field Origin item 1 # 'Receivings Trx Entry'
MoveTo field 'Batch Comment'
  MoveTo field 'Post Button'
  ClickHit field 'Post Button'
NewActiveWin dictionary 'default'  form 'Progress_Control' window 'Progress_Window'
NewActiveWin dictionary 'default'  form 'POP_Batch_Entry' window 'POP_Batch_Entry'


#!CLOSE AND END

CloseWindow dictionary 'default' form 'POP_Batch_Entry' window 'POP_Batch_Entry'
NewActiveWin dictionary 'default' form sheLL window sheLL
CommandExec form BuiLtin command cmdQuitApplication

Monday, January 28, 2013

Processing 2012 Payroll year end after loading 2013 payroll tax tables

Variations of this problem have been popping up everywhere, as it often does when changes are made to the payroll tax percentages and limits. I wrote this up to answer one of the forum posts, so I thought I would brush it off and publish it.
Here was the scenario:
The company had downloaded the 2013 payroll tax tables and processed 2013 payroll, but neither closed 2012 payroll nor installed the year end update for 2012.
Now they need to close 2012 payroll and then return to processing 2013 payroll. Here’s what I would do to get back on track.
1.       Download and install the January hotfix of Dynamics GP 2010, this includes the year end tax update (as well as a hot fix). The current build is 11.00.2164. It was released 01/24/2013. Be sure you have a backup, this will require a table update. Backup your forms and reports dictionaries and create package files for all of your modifications.
2.       Open the Payroll Tax Tables window and change your FICAS tax code to a wage limit of $110,100 and a rate of 4.2%
a.       To open the Payroll Tax Tables window follow the instructions below.
b.      Navigate to: Administration | Setup | System | Payroll Tax.

c. Select the FICAS tax code, select the Apply Tax Table item and click the Filing Status button.

d. Select the NA filing status and click the Tables button

e. Edit the table rates and change the But Not Over column to $110,100 and the Tax Rate column to 4.2% and then click the OK button.

3.   Click Save on the Payroll Tax Filing Status window.
4.   Click Save on the Payroll Tax Setup window.
5.   Now, your going to remove the extra Medicare Tax for the high income earners.
a. In the Payroll Tax Setup window select the Tax Code FICAM, Apply Tax Table, and then click the Filing Status button.

b. Select the NA filing status and click the Tables button

c. To remove the second row in the table, place your cursor in the second row, choose Edit from the menu bar and then Delete Row.

d. Now you need to adjust the first row's maximum wage by entering $999,999,999.99 in the But Not Over column. Click OK to save and close the window.

6.   Click Save on the Payroll Tax Filing Status window.
7.   Click Save on the Payroll Tax Setup window.
8. Change the user date to 12/31/2012 (anything in 2012 will do)
9.   Create the year end wage file (close payroll).
10.  Make sure you’re happy with the W-2 amounts.
11.  Load the 2013 tax tables using the Payroll Tax Updates wizard
12.  Check to make sure the FICAS amounts reset to a wage limit of $113,700 and a rate of 6.2%
13.  Check to make sure the FICAM table includes the 2.35% extra for wages over $200,000.00.
14.  Don't forget to set the User Date back to the right date to process 2013 payroll!
That should get you fixed back up.
Until next post!
Leslie



































Friday, January 11, 2013

Round 2 2013 Payroll Tax Table update Released!

It’s time to update your payroll tax tables.

The Round 2 2013 tax tables have just been released! The update is available for versions 10 (last one for this version), GP 2010 and GP 2013.

Enjoy!

Leslie