Pages

Friday, March 21, 2014

Using Copy and Paste in a GP Macro

What if you want to copy and paste using a GP Macro? You can easily do it, but there’s a little trick to it. Let’s learn how!

The requirement was to create a bunch of manual payments with the User ID of who entered the payment being entered into the comment field. While there are many ways to accomplish this task, the client determined that using a mail-merge macro would be the best way to go.

Since the user running the macro is not static, the User ID needed to be copied from the GP Welcome window. The relevant part of the recorded macro is shown below. The copy and paste lines are highlighted.

CommandExec dictionary 'default'  form 'Command_System' command UserID
NewActiveWin dictionary 'default'  form Login window Login
  CommandExec form BuiLtin command cmdEditCopy 
  MoveTo field 'Cancel Button'
  ClickHit field 'Cancel Button'
NewActiveWin dictionary 'default'  form sheLL window sheLL
ActivateWindow dictionary 'default'  form 'PM_Manual_Payments' window 'PM_Manual_Payments'
  CommandExec form BuiLtin command cmdEditPaste
  TypeTo field 'Transaction Description' , 'sa'

Instead of actually performing the standard copy and paste, the macro hard-coded what it copied and retains that value forever. That’s not what they want, they need the recorded User ID to change dynamically according to whomever is logged in.

The solution is simple. When you record your macro, choose ‘Select All’ from the Edit menu and then select ‘Copy’. Do the same when you go to paste and the macro will perform the copy and paste function correctly. Here’s what the new macro code looks like after the change:

  CommandExec dictionary 'default'  form 'Command_System' command UserID
NewActiveWin dictionary 'default'  form Login window Login
  CommandExec form BuiLtin command cmdEditSelectAll
  CommandExec form BuiLtin command cmdEditCopy

  MoveTo field 'Cancel Button'
  ClickHit field 'Cancel Button'
NewActiveWin dictionary 'default'  form sheLL window sheLL
ActivateWindow dictionary 'default'  form 'PM_Manual_Payments' window 'PM_Manual_Payments'
  MoveTo field 'User Defined 1'
  CommandExec form BuiLtin command cmdEditSelectAll
  CommandExec form BuiLtin command cmdEditPaste
  MoveTo field 'User Defined 2'

Hopefully this little tip will help you record more dynamic macros.

Until next post!

Leslie

Sunday, March 2, 2014

Convergence 2014 ! Pre-pre game–Atlanta

image

Left for Atlanta this morning (March 1st, 2014). It was cold and foggy in Dallas, so foggy that I had to slow down to read the signs on the highway. Still, I got to the airport on time, to my surprise I was ushered through the TSA Pre-check line. This pre-check deal is the way to go! I got to leave my shoes on, my laptop in its case and my quart-sized Ziploc bag full of toothpaste in my carryon luggage.

As I was walking through the DFW airport on my way to the gate, I noticed an odd product for sale:image

‘N-Tune’ reminded be of a Microsoft product I worked with when it was in beta: image

I thought then that the name was similar to:image

What will be next?? 

 

I boarded one of the newest American Airlines Airbus planes. Wow! The seatback in front of me had an entertainment system, a dedicated three-prong plug and powered USB port. There was even an airbag stuffed into my seatbelt. Take a look:image 

For now, the entertainment system is free, that will change in the future. In the mean time, if you have a chance to book your flight on one of the new Airbus planes, do it.

I had another surprise at the Atlanta airport. They have free payphones! How can a ‘pay’ phone be free? But still, you could call anywhere free for 5 minutes:

image

 

Cab fare from the airport to the convention center is a fixed fare of $40. I opted for the airport shuttle. You can get a round-trip ticket to/from convention center hotels for $29 or $16.50 one way. To take advantage of the shuttle, head towards ‘Ground Transportation’ to get your ticket. It’s a short wait and I was the only passenger. My day was still going well.

A quick trip on the shuttle, not too much traffic:

image

At last, I had arrived. I’m staying at the Omni; Sheila Jefferson-Ross will be my roomie. We are in room 1005, if anyone want's to call Smile.

It’s my kind of room – near the elevator. Also, look at this great view right outside my window:

image

The Ferris wheel is a light show at night – pretty cool, lots of colors. I’ve never had a ride on a Ferris wheel, perhaps this will be the time!

Convergence will be a real blockbuster this year, as always. More to come!

Until next post!

Leslie