infor.com
concierge
infor u
developer portal
Posts
Categories
Groups
Hubs
Developer
Healthcare
Hospitality
Public Sector
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
Your Groups
User Groups
Migrated Forums
FSM/HCM/S3 - Infor Lawson 10.x
HCM/S3 - Learning and Development
HCM/S3 - Global HR
HCM/S3 - Talent Acquisition
HR Service Delivery
Human Capital Management (HCM) - EMEA
Infor Configuration Management for Service Industries
Lawson - Business Intelligence
Lawson - Financials
Lawson - Human Resources
Lawson - Supply Chain
Lawson - Supply Chain Management
Lawson - Technology
MSCM on Landmark
About
Community News
Email Community Support
Home
Groups
VISUAL - Enterprise Customer Community
Attach a drawing a purchase order
collinajong-andoh
Is there any way to attach the drawing file stored in Part Maintenance for each line item on a purchase order and have it print automatically when the PO is printed?
Find more posts tagged with
Comments
Legacy Contributor
Yes. Assuming your version of VISUAL has document references, you can use a macro to create purchase order line references from the drawing file. The references will then print out if you check 'Print Associated Documents' on the print screen.
Legacy Contributor
Interesting post! We would like to try this out. Jeremy, would you be willing to share any suggestions on how this macro would work or perhaps some code?
Would the document reference be created with the same path as the drawing file? Or should the current version drawing file be copied into a centralized document reference directory and linked to the PO? How do you loop through the PO lines? Thanks!
Legacy Contributor
There's a couple ways to loop through line items.
1. Every VISUAL window that has line items will have a LINES object that references the line item data. So you can write something like:
set arrOrderLines = LINES.value
for i = 0 to arrOrderLines.count - 1
msgbox(LINES(i).value("PART_ID"))
next
which will output the part ID from each line to a message box. If you need to know what fields are available in the LINES object, you can use this macro that Rich Ferlatte posted a few years ago:
www.visualnuggets.com/.../fantastic-macro-to-see-available-fields-of-the-lines-object.html
The other way is to query the line item table from the macro.
dim strServer, strDatabase, strUid, strPwd, strConnect, conn, strSql, rs
strServer = "[Your Database Server]"
strDatabase = DATABASE
strUid = "[Your Database User]"
strPwd = "[Your Password]"
strConnect = "Driver={SQL Server};Server=" & strServer & ";Database=" & strDatabase & ";Uid=" & strUid & ";Pwd=" & strPwd & ";"
strSql = "select PART_ID from PURC_ORDER_LINE where PURC_ORDER_ID = '" & ORDER_ID & "'"
'open recordset for reading
Set rs = CreateObject("ADODB.Recordset")
rs.open strSql, strConnect
do while not rs.EOF
strPartID = rs("PART_ID")
msgbox(strPartID)
rs.movenext
loop
rs.Close
set conn = nothing
Important Links
Community Hubs
Discussion Forums
Groups
Community News
Popular Tags
CPQ: Ask a Colleague
FAQs, How-To, and Best Practices
Idea
Infor OS Portal
UI Design
CPQ: Tips and Tricks
Infor Homepages
Widget Development
Infor EPM Migration
Infor Ming.le