web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Carriage Returns in Notes and Report Writer

(0) ShareShare
ReportReport
Posted on by 1,588

http://blogs.msdn.com/b/developingfordynamicsgp/archive/2011/02/02/adding-more-comments-to-sop-documents.aspx 

http://dynamicsgpblogster.blogspot.com/2012/05/adding-more-comment-lines-to-pop.html 

So there are these two posts from Musgrave and Gomez respectively, dealing with adding comments to reports. The techniques of which should translate to adding note text to an In-Transit packing slip using RW_GetNoteText - this report writer function is coded to fetch and return lines in exactly the same way as the functions described in David and Mariano's posts. (Interestingly, these report writer functions were all coded by David Musgrave in 2002). The problem I'm facing is we have note text formatted as an address:

DIRECT SHIP

C/O Chad Bruels

123 Main St

Everywhere, CA 12345

The carriage returns are problematic. If one follows the recommendation in these posts and sets the Number of Characters per Line parameter to 80, the first note field on the report will print DIRECT SHIP and all others are blank. The Field_ParseText() function used in these methods states that it will not return any more characters when it encounters a carriage return, but that you can call it again to begin parsing immediately following that carriage return. The problem is the report writer functions do not take that into account, they simply exit having encountered a carriage return.

Now, considering I have note text that in total is shorter than 80 characters, the second calculated note field on my report gets nothing and I see no way to choose a smaller number for this parameter as every address line will contain a different number of characters. The problem is their posts seem to state the carriage returns should not actually be problematic. In the Solution section they offer this: This gives the potential for 640 characters and so should easily be able to display the 500 characters of comment text (even without breaking words in half or additional carriage returns).

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Almas Mahfooz Profile Picture
    11,009 User Group Leader on at

    try this may be you will get the results.

    note2.png

    note2.png

    note3.png

  • Verified answer
    chadbruels Profile Picture
    1,588 on at

    It turns out the notes I'm dealing with do not simply have carriage returns, they have carriage returns followed by line feeds. 

    Tim Wappat kindly provided a method by which a person can determine what hidden characters exist in a note field in this blog post : http://www.timwappat.info/post/2016/01/07/Find-carriage-return-(cr)-and-line-feed-(lf)-in-NOTES-fields-of-Dynamics-GP

    That method revealed that the notes looked like this:

    DIRECT SHIP[cr][lf]C\O Chad Bruels[cr][lf]....

    [cr] = carriage return

    [lf] = line feed

    The next step was determining whether using just one of these allowed the RW_GetNoteText method described in the Musgrave/Gomez solution to be successful. Again, Tim was helpful in providing this : http://www.timwappat.info/post/2013/09/10/Formatting-notes-using-GP-econnect 

    I modified his replace() function to substitute each [lf] with a blank space, leaving my note formatted like this:

    DIRECT SHIP[cr]C\O Chad Bruels[cr]....

    This note now worked with the Gomez/Musgrave Report Writer technique. 

    I was creating these notes from a GP Add-in coded in C# using Environment.NewLine to format my note. Armed with the knowledge above, I replaced these simply with "\r" to create the note only with the [cr] carriage returns. 

    Thanks also to Steve Endow for a blog post that got me thinking I should be able to reveal the hidden characters in the note and for reaching out to Tim Wappat for further assistance knowing he had tackled this before. 

  • Almas Mahfooz Profile Picture
    11,009 User Group Leader on at

    Wow. :)

    Three years back I have to insert carriage return to my notes field to make it more readable for user. It's the requirement which make us do interesting things.

    https://evspakistan.wordpress.com/2012/10/25/how-to-insert-crcarriage-return-from-sql-in-dexterity-text-field/

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans