#GPPT Fixing the 80 character limitation for the rw_CreateSOPTrackingNumberString report writer function

David Meego - Click for blog homepageYesterday, I had a quick chat with one of the legends of the Microsoft Dynamics GP community as they were preparing a session for the upcoming Community Summit 2023 in Charlotte, NC, USA and hit a technical issue which is actually a limitation in Dexterity (the development tool behind Microsoft Dynamics GP).

Read on to find out who is returning to Summit this year and how GP Power Tools solved their problem with the rw_CreateSOPTrackingNumberString() report writer function.

I can’t keep you waiting in suspense any longer. My great friend and GP Legend, Leslie Vail is coming to this year’s Summit to say “Hi” to everyone and present a session on Report Writer User Defined Functions.

While working on the materials for her session, Leslie came across the 80 character limitation on Report Writer Calculated fields where a string returned is truncated to 80 characters. This is a known issue which is not going to be fixed.

The only solutions possible require a custom Dexterity dictionary or simply the use of a custom Report Writer function using GP Power Tools.

In a previous example, we were able to use the RW_ParseString() report writer function (which is based on the Field_ParseText() Dexterity function) to split the returned data into lines using the nearest space character before the 80 character limit.

That method will not work for the rw_CreateSOPTrackingNumberString() report writer function because it returns the tracking numbers separated with only a comma character and does not include any spaces.

So, I created a project with two versions of the custom report writer function to wrap the rw_CreateSOPTrackingNumberString() report writer function and split the results based on finding the comma characters.

The first version splits the Tracking Numbers into lines of up to 80 characters and can be called from a report writer calculated field in the format below (last parameter is the line number):

  • rw_TableHeaderString(5261, “SOP_TRACKING”, ‘SOP Number’, ‘SOP Type’, 1)
  • rw_TableHeaderString(5261, “SOP_TRACKING”, ‘SOP Number’, ‘SOP Type’, 2)

The second version splits the Tracking Numbers into individual numbers and can be called from a report writer calculated field in the format below (last parameter is the field number):

  • rw_TableHeaderString(5261, “SOP_TRACKING_2”, ‘SOP Number’, ‘SOP Type’, 1)
  • rw_TableHeaderString(5261, “SOP_TRACKING_2”, ‘SOP Number’, ‘SOP Type’, 2)

The screenshot of the Project Setup window below shows the two custom Report Writer functions SOP_TRACKING and SOP_TRACKING_2 as well the testing script SOP_TRACKING_T and the associated Parameter List and SQL Lookup script.

Edit the Parameter List to edit in the default SOP Type and SOP Number you are using for testing. Then you can use the SOP_TRACKING_T script to show the full result from the original function and the results of both custom functions.

Downloading and Installing

Download the example code, import using the Project Setup window (now possible for first time imports with Build 28.8 onwards), or use Configuration Export/Import window (for older builds):

The code will be active as soon as it is loaded.

More Information

For more information see:

Hope you find this example useful.

David

This article was originally posted on https://www.winthropdc.com/blog.

Leave a Reply