Announcing Report Writer Function RW_ConvertToWordsAndNumbersParse


David Meego - Click for blog homepageWith the release of Microsoft Dynamics GP 2010 (formerly known as GP "11"), the issue with the RW_ConvertToWordsAndNumbers() report writer function caused by the 80 character limitation on string calculated fields has been resolved with the addition of a RW_ConvertToWordsAndNumbersParse() report writer function which has the RW_ParseString functionality built in.

For more information on the original issue and a work around using Visual Basic for Applications (VBA) see the following blog post:

Hybrid - Cheque Amount in Words Example

Below is the SDK entry for the new function:


RW_ConvertToWordsAndNumbersParse

Module:
System Manager

Series:
System

Script type:
Global function

Form (If a form global):

Category:
Numeric Manipulation

Description:
Convert currency value to Words and Numbers, using descriptive terms from the Currency ID supplied. Returns the result parsed into lines of a specified length. Uses the Dexterity Field_ParseText() function.

Prerequisites:
none

Parameters:
in currency   IN_Value.       { Value of Currency }
in string       IN_Currency.   { Currency ID of Currency - Leave Blank for Functional }
in integer     IN_Mode.        { non-zero = Use Numbers and Words instead of only Words }
in integer     IN_characters. { Number of Characters per Line }
in integer     IN_line.           { Line Number to Return }

Return Value:
function returns string OUT_string.


So an example of using the function return the amount in words and numbers to 3 lines of 80 characters into 3 string calculated fields is:

Name: (c) ConvertToWordsAndNumbers1
Result Type: String
Expression Type: Calculated
Calculated: FUNCTION_SCRIPT(RW_ConvertToWordsAndNumbersParse  cyPrintTotal   (c) Currency ID  0   80   1)

 

Name: (c) ConvertToWordsAndNumbers2
Result Type: String
Expression Type: Calculated
Calculated: FUNCTION_SCRIPT(RW_ConvertToWordsAndNumbersParse  cyPrintTotal   (c) Currency ID  0   80   2)

 

Name: (c) ConvertToWordsAndNumbers3
Result Type: String
Expression Type: Calculated
Calculated: FUNCTION_SCRIPT(RW_ConvertToWordsAndNumbersParse  cyPrintTotal   (c) Currency ID  0   80   3)

 

Note: This new function is not included in the Microsoft Dynamics GP 2010 Beta code, you will need to install the final released code to be able to use it.

The following articles are related:

RW - Getting RW_ConvertToWordsAndNumbers() to work with multi-currency

RW - Getting RW_ConvertToWordsAndNumbers() to show cents in words

Enjoy using the new function and not having to worry about characters above the 80 mark being truncated.

David

17-Nov-2010: Attached RM Blank Document Package using RW_ConvertToWordsAndNumbersParse function.

RM Blank Document.zip

Comments (6)

  1. Peter says:

    Is it possible that you could create a customized RM Blank Document package? Am trying using the above methods but i can't get it right. Amounts in words for receivables invoice (blank document);

    Thank you

  2. David Musgrave says:

    Hi Peter

    I had a look at the RM Blank Document report and would suggest adding the amount in words as a calculated field into the Report Footer (RF) section.  Make sure that the fields passed are the calculated Field Display Total and the RM_OPEN_TEMP.Currency ID table field, finish with the integer constants 0 80 and 1,2 or 3 for the lines.

    I have attached the RM Blank Document package with the calculated fields added.

    David

  3. I am trying to do this for the SOP Blank Invoice on the (c)ItemDescription field and cannot seem to make it work, where is the cyPrint Total coming from? Is it just a constant? I am a little lost.

    Thanks

    Jenn

  4. David Musgrave says:

    Hi Jenn

    It sounds like you are looking for the example using RW_ParseString() shown at

    blogs.msdn.com/…/showing-the-full-item-description-on-invoices-example.aspx

    David

Skip to main content