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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Macro - Line Copy

(0) ShareShare
ReportReport
Posted on by 1,445

I am trying to create a macro for a purchase order.  I want to copy whatever I type in the item description, copy it and then cntl-d and paste it for the vendor item description (this is what prints on the po).  When I create it and run it, it is copying what I type the first time instead of whatever I currently type in.  When I try to go to line 2 and hit my run (i have set to use f2) button, it doesn't copy and paste anything - it runs it for the first line again.  I have used the edit, select all and then copy but it is not working correctly.  Any help would be appreciated.

Below is what is on the notepad:

# DEXVERSION=10.0.313.0 2 2
CheckActiveWin dictionary 'default'  form 'POP_PO_Entry' window 'POP_PO_Entry'
  CommandExec form BuiLtin command cmdEditSelectAll
  CommandExec form BuiLtin command cmdEditCopy
  MenuSelect title Options entry 'Display Vendor Item'
# Key 1:
  MoveTo line 1 scrollwin 'Line_Scroll' field 'Vendor Item Description'
  CommandExec form BuiLtin command cmdEditSelectAll
  CommandExec form BuiLtin command cmdEditPaste
# Key 1: '36753', '16384', '0'
  TypeTo line 1 scrollwin 'Line_Scroll' field 'Vendor Item Description' , 'testing'
# Key 1: '36753', '16384', '0'
  MoveTo line 1 scrollwin 'Line_Scroll' field 'Location Code'
# Key 1: '36753', '16384', '0'
  MoveTo line 1 scrollwin 'Line_Scroll' field 'QTY Canceled'
# Key 1: '36753', '16384', '0'
  MoveTo line 1 scrollwin 'Line_Scroll' field 'Extended Cost'
  TransLinePrepare scrollwin 'Line_Scroll'
# Key 1:
  MoveTo line 2 scrollwin 'Line_Scroll' field 'Vendor Item Number'
  MenuSelect title Options entry 'Display Vendor Item'
# Key 1:
  MoveTo line 2 scrollwin 'Line_Scroll' field 'Item Number'

*This post is locked for comments

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

    Every time you run the macro it executes the code and moves back to line 1.

    Do the number of lines on your purchase order tend to be around the same number? You are on the right track however your macro will need the be recorded and edited with the cmdeditpaste for each line item you plan to add.

  • Suggested answer
    Community Member Profile Picture
    on at

    The current macro is just recorded for the first line. You have record macro and capture it for the second line as per your above requirement and need to change the description for that line.

    The line items will not always be the same for all the Purchase Order, in this case you have to keep on increase the macro lines for lines added in the Purchase order.

    If you enter a item on the purchase order, are you not receiving a information message asking the user to chose " This item hasn't been assigned to a vendor Item no. Do you want to assign, by clicking yes it opens the vendor item maintenance. In this case, you don't need a macro.

    Option 1: In Purchase Order Setup window, you have the option "Display Items during Entry By" set it as "Vendor Item", the purchase order entry window will only display the vendor Items.

    Option 2: If you know the vendor for the Items, you can directly run the macro on the Item Vendor Maintenance.

  • Suggested answer
    Mahmoud Saadi Profile Picture
    32,738 on at

    Why are you filling in the vendor item at the purchase order level ! You can simply do that on the item-vendor assignment window.  That will save you a lot of headache regarding the item line numbers

    (Cards > Inventory > Vendors)

    On this screen, you will have to pick your item, then vendor and then fill in a vendor item. Here is the code "simply"

    # DEXVERSION=14.00.0072.000 2 2
    CheckActiveWin dictionary 'default'  form 'IV_Item_Vendors' window 'IV_Item_Vendors' 
      MoveTo field '(L) Location GB' item 0  
      TypeTo field 'Item Number' , 'ItemNumber'
      MoveTo field '(L) Location GB' item 0
      MoveTo field 'Vendor ID' 
      TypeTo field 'Vendor ID' , 'VendorId'
      MoveTo field 'Vendor Item Number' 
      TypeTo field 'Vendor Item Number' , 'Item Vendor ID'
      MoveTo field 'Save Button' 
      ClickHit field 'Save Button' 
    


    Your feedback is highly appreciated,

  • MCARTER Profile Picture
    1,445 on at

    The reason I would like to be able to copy and paste is for my misc part #'s.  I have a part # named PARTS, SOR, RRS, etc for misc items that i just need to put into inventory and invoice out to a customer. I will list the vendor part # and description for the line item description, then want to copy it to the vendor item description so it shows on the printed purchase order.  I have ranges of 1 to 20 lines per purchase order.

  • Suggested answer
    L Vail Profile Picture
    65,271 on at

    Hi,

    You need to delete the 'TypeTo line 1 . . . ' line of the macro. It should work then.

    Kind regards,

    Leslie

  • Verified answer
    L Vail Profile Picture
    65,271 on at

    Hi again,

    Here's a slide from my Macro class. Note the last item about removing the 'type to' line.

    Kind regards,

    Leslie

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Shravan Attelli Profile Picture

Shravan Attelli 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans