Easily Automate Text Block Creation in M3
Nov 25 2014
Here’s a useful tip from one of our Business Consultants, Joseph Konka. If you need to automate the creation of text blocks in M3, API CRS980MI makes the process easy. This article shows an example of how to generate a Text Block and assign it to an item, using the Item Master, MITMAS…
All text requires a unique identifier that will be assigned to both the text block and the related M3 transaction or master data. The first step then is to retrieve a new Text ID from CRS980MI/RtvNewTextID.
Note: Its important to use the correct text header table, please refer to the end of this article for a general guide to selecting the right text header-table.
Figure 1. CRS980MI/RtvNewTextID – INPUT
Figure 2. CRS980MI/RtvNewTextID – OUTPUT
Next, assign the new Text ID to the MITMAS table row based on the primary key. The view for the primary key can be found in MDP by accessing the database table and retrieving the index with a unique key.
Text Block headers and lines can now be generated in the text file. Generate the text header via AddTxtBlockHead:
Generate the text lines via AddTxtBlockLine:
The item Y10032 now shows text under the selected Text Block:
Figure 3: MMS001 Text Block Now Created
Note: Column KV01 is always Company Number (CONO)
Using the Correct Text Header Table
Text block generation requires that the correct text header table is identified. In the MITMAS example we are using in this blog, that would be the MSYTXH text header table (shown red in the guide below.)
General Guide to Text Header Tables:
|Purchase Order confirmations – PPS2xx
|Finance – APSxxx, ARSxxx, CRS6xx, FASxxx
|CO Pricelist report – OIS538
|MSDS – MSSxxx
|ECSxxx, MMSxxx, MOSxxx, MWSxxx, PDSxxx, PPSxxx
|COSxxx, JTSxxx, OISxxx, POSxxx, SASxxx, SOSxxx
|HRSxxx, PRSxxx, TESxxx
Note: This table is a general guide to selecting the right text header, but there are always exceptions to the rule.