web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Troubleshooting GP Macros

(0) ShareShare
ReportReport
Posted on by 290

I am using GP macros to automate the check selection process – this client has a large number of checks to select and macros seem to be the only way to do so.

I am puzzled by an error – Error on line 30: Cannot type to Field VendorID.

I have looked at the macro file and see no errors.  (see macro text below)

This macro works perfectly sometimes and fails at other times. it is the same macro file, not a recreated version. i.e. I can try the macro, get the error. Restart the computer, use the same macro file, and it works.

Sometimes, even restarting does not help.

Today, I tried to get the error, and it worked perfectly every time, so I can’t even attach a screenshot.

Any insight on what could be causing this?  would waiting a second or two before typing to field help?  If yes, what is the syntax for the wait command?

Regards

Habib

------------------------ macro code-------------------

# DEXVERSION=14.00.0073.000 2 2
ClickHitIE , 'dexterity/.../args=0,1566,24'
NewActiveWin dictionary 'default'  form 'PM_Mass_Voucher_Selection' window 'PM_Mass_Voucher_Selection'
ActivateWindow dictionary 'default'  form 'PM_Mass_Voucher_Selection' window 'PM_Mass_Voucher_Selection'
  TypeTo field 'Batch Number' , '151001IRNSTOPAY'
  MoveTo field '(L) Select By' item 1  # 'Vendor ID'
NewActiveWin dictionary 'default'  form DiaLog window DiaLog
  ClickHit field OK
NewActiveWin dictionary 'default'  form 'PM_Mass_Voucher_Selection' window 'PM_Mass_Voucher_Selection'
NewActiveWin dictionary 'default'  form 'PM_Batch_Entry' window 'PM_Batch_Entry'
ActivateWindow dictionary 'default'  form 'PM_Batch_Entry' window 'PM_Batch_Entry'
ActivateWindow dictionary 'default'  form 'PM_Batch_Entry' window 'PM_Batch_Entry'
  CommandExec dictionary 'default'  form 'PM_Batch_Entry' command 'Save Button_w_PM_Batch_Entry_f_PM_Batch_Entry'
ActivateWindow dictionary 'default'  form 'PM_Mass_Voucher_Selection' window 'PM_Mass_Voucher_Selection'
ActivateWindow dictionary 'default'  form 'PM_Mass_Voucher_Selection' window 'PM_Mass_Voucher_Selection'
 MoveTo field '(L) Start Vendor ID'
  TypeTo field '(L) Start Vendor ID' , 'PRO7003'
  MoveTo field '(L) End Vendor ID'
  MoveTo field 'Insert>> Button I'
  ClickHit field 'Insert>> Button I'
  MoveTo field '(L) Select By' item 1  # 'Vendor ID'
  ClickHit field '(L) Select By' item 6  # 'Document Number'
  MoveTo field '(L) Start Document Number'
  TypeTo field '(L) Start Document Number' , '1003930'
  MoveTo field '(L) End Document Number'
  MoveTo field 'Insert>> Button I'
  ClickHit field 'Insert>> Button I'
CommandExec dictionary 'default'  form 'PM_Mass_Voucher_Selection' command '(L) Build Batch Button_w_PM_Mass_Voucher_Selection_f_PM_Mass_Voucher_Selection'
 MoveTo field '(L) Start Vendor ID'
  TypeTo field '(L) Start Vendor ID' , 'NOR7026'
  MoveTo field '(L) End Vendor ID'
  MoveTo field 'Insert>> Button I'
  ClickHit field 'Insert>> Button I'
  MoveTo field '(L) Select By' item 1  # 'Vendor ID'
  ClickHit field '(L) Select By' item 6  # 'Document Number'
  MoveTo field '(L) Start Document Number'
  TypeTo field '(L) Start Document Number' , '1009617'
  MoveTo field '(L) End Document Number'
  MoveTo field 'Insert>> Button I'
  ClickHit field 'Insert>> Button I'
CommandExec dictionary 'default'  form 'PM_Mass_Voucher_Selection' command '(L) Add to Batch Button_w_PM_Mass_Voucher_Selection_f_PM_Mass_Voucher_Selection'
NewActiveWin dictionary 'default'  form DiaLog window DiaLog
  ClickHit field OK
NewActiveWin dictionary 'default'  form 'PM_Mass_Voucher_Selection' window 'PM_Mass_Voucher_Selection'
 MoveTo field '(L) Start Vendor ID'
  TypeTo field '(L) Start Vendor ID' , 'PRO7009'

*This post is locked for comments

I have the same question (0)
  • KirkLivermont Profile Picture
    5,985 on at

    Are you using any of the tools in the professional services tool library (PSTL)?

    Regards,

    Kirk

  • Habib Profile Picture
    290 on at

    Not on this machine.

  • KirkLivermont Profile Picture
    5,985 on at

    Habib,

    There is no wait command that I am aware of when using GP macros. The issue that you are having is likely a variable in the data that causes an unexpected dialog window to pop up. I asked about the PSTL because I seem to recall there being a tool that checks the vendor against POs in the system but I am having trouble finding the documentation regarding this.

    Best regards,

    Kirk

  • Habib Profile Picture
    290 on at

    Hi Kirk,

    The problem is in the macro execution, not in the vendor nor macro code.  Proof that is the fact that the macro works after a reboot.  or sometime just on a second try.  Note: I am not generating a new macro file.  it is the same file that failed in an earlier attempt.

    I think i have a workaround of sorts.  I haven't tested it extensively, so i would not be terribly surprised if the error popped up again but here is what seems to work.

    I fudged a wait by adding two lines after line 29.  For you convenience:

    ----Before----

    ActivateWindow dictionary 'default'  form 'PM_Mass_Voucher_Selection' window 'PM_Mass_Voucher_Selection'
     MoveTo field '(L) Start Vendor ID'
      TypeTo field '(L) Start Vendor ID' , 'PRO7003'  # line 30
      MoveTo field '(L) End Vendor ID'
      MoveTo field 'Insert>> Button I'

    ----After----

    ActivateWindow dictionary 'default'  form 'PM_Mass_Voucher_Selection' window 'PM_Mass_Voucher_Selection'
     MoveTo field '(L) Start Vendor ID'

    MoveTo field '(L) End Vendor ID'  # waste a few milliseconds

    MoveTo field '(L) Start Vendor ID' #end waste
      TypeTo field '(L) Start Vendor ID' , 'PRO7003'  # line 30
      MoveTo field '(L) End Vendor ID'
      MoveTo field 'Insert>> Button I'

  • KirkLivermont Profile Picture
    5,985 on at

    Habid,

    Thank you for teaching me something new. Please let me know what you experience using your workaround.

    Regards,

    Kirk

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans