infor.com
concierge
infor u
developer portal
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
VISUAL - Enterprise General Discussions
Comments
unknown
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.
unknown
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!
unknown
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
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Help
Popular Tags
Infor Lawson Human Resources Group - Discussion
Infor Lawson Technology Group - Discussion
General Discussions
VISUAL - Enterprise General Discussions
Infor Lawson Supply Chain Management - Discussion
Process Automation (IPA) - General Discussions
Pegasus - Partner General Discussions
Infor Lawson Supply Chain Group - Discussion
Infor Lawson Financials Group - Discussion
Infor EPM Discussions