infor.com
concierge
infor u
developer portal
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
ION Connect
ION Workflow
ION API Gateway
Syteline Development
CPQ Discussion Ask a Colleague
Infor Data Fabric
Infor Document Management (IDM)
LN Development
API Usage
FAQs, How-To, and Best Practices