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.
↧