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
Macro Part Maintenance
Legacy Contributor
I would like to create macro in Part Maintence that would populate the accounting tab with a certain GL everytime one certain commodity code is chosen. Would also like to require the Product and Commodity code drop downs to be selected On Save.
Find more posts tagged with
Comments
Legacy Contributor
Typically you would use product code to drive the accounting and not override the Inventory Accounting on the part level. Have you looked at that as an option? However, something like this should get you started. You will need to populate the select case with the different commodity code and GL code combinations you want to use and TEST!! You will also want to think about what will happen if someone changes the commodity code which then in turn changes the GL codes and you have inventory on hand. This will really screw up your Inventory Accounting because it would have gone in to inventory with one GL code and then will come out with another GL code.
Name the macro OnSave
If COMMODITY_CODE = "" then
msgbox "Commodity Code is Blank - Can Not Save Part",vbOKOnly
MACRO_SUCCESS = FALSE
Else
End If
If PRODUCT_CODE = "" then
msgbox "Product Code is Blank - Can Not Save Part",vbOKOnly
MACRO_SUCCESS = FALSE
Else
Select Case COMMODITY_CODE
Case "XX"
MAT_GL_ACCT_ID = "XXXX-XXXX"
Case "YY"
MAT_GL_ACCT_ID = "YYYY-YYYY"
Case "ZZ"
MAT_GL_ACCT_ID = "ZZZZ-ZZZZ"
End Select
End If
MACRO_MESSAGE = "Part Not Saved"
Best of Luck,
Scott
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