Here is another support case that was resolved simply and quickly using the Support Debugging Tool.
The customer was using Extender to add an additional comment to the inventory stock transfer transaction. They created an Extender ID "ST_COMMENTS" and used the Long String field type in Extender which is a 255 character string. This worked fine.
Then the customer wanted to include the Extender field on the posting reports. There is a Knowledge Base (KB) article that explains how to use a calculated string field and a user defined report writer function to return Extender to a report. click on the link below for more details:
The instructions are to use the rw_TableHeaderString() report writer function and pass through the following parameters:
- Product ID: For Extender 3107
- Extender ID: In our case "ST_COMMENTS"
- Key Field: In our case IV_TRX_WORK_HDR.IV Document Number, but I will use Table.FieldName
- Not used: Integer constant of 0
- Field Number: In our case 1
So below is the definition of the Comment calculated field:
Comment = FUNCTION_SCRIPT( rw_TableHeaderString 3107 "ST_COMMENTS" Table.FieldName 0 1 )
To break the 255 character string into 4 lines of up to 80 characters each the following calculated fields were also created using the RW_ParseString() report writer function:
Comment1 = FUNCTION_SCRIPT( RW_ParseString Comment 80 1 )
Comment2 = FUNCTION_SCRIPT( RW_ParseString Comment 80 2 )
Comment3 = FUNCTION_SCRIPT( RW_ParseString Comment 80 3 )
Comment4 = FUNCTION_SCRIPT ( RW_ParseString Comment 80 4 )
In theory this should work perfectly. In practice it fails badly.
The problem is that there currently is a 80 character limit on the size of string calculated fields in report writer. This limit is discussed in the following post: Hybrid - Cheque Amount in Words Example and required additional code to be written to solve it for the one function: Announcing Report Writer Function RW_ConvertToWordsAndNumbersParse. The problem report number for the 80 character limit is PR 5239.
The end result was that only the first 80 characters of the Extender long string was returned and so only the first line of the 4 Comment lines was populated. It was at…