This is a reposting of an article I originally wrote on my Developing for Dynamics GP blog.
A recent newsgroup post asked about how to fix the error message shown below from occurring when clicking the Attach button on the Note window for a record level note.
“The note ID has not been set.”
The cause of the message is that the ‘Note Index’ value for the Transaction or Master record has not been set and so remains at zero.
The post Understanding Notes and the Note Index field explains how the Note Index is used and where the next Note Index comes from. It also explains how cross linked notes can occur. This post will discuss missing Note Index values and how they can occur.
The usual cause is because the data has been imported in some way and the import process did not populate the ‘Note Index’ field. Depending on what the import process actually is, you might need to log this issue with support so that it can be fixed.
Also, If you can make this problem occur for a master record or transaction newly entered via the user interface, then there is a bug in the code for that window and you will need to log this issue with the developer.
So, once there is data with a missing Note Index value, how can we fix it…. The answer is “easily”.
My friend, Robert Cavill, provided me with a script he had created which can scan a table for missing ‘Note Index’ values. The script updates the table with the next Note Index for the company. It does so by using the existing DynamicsGP stored procedure: smGetNextNoteIndex. This AssignNoteIndex.sql script is attached to the bottom of this post. You just need to specify the table name to process by editing the value at the top of the script.
Before using AssignNoteIndex.sql, I would suggest running the script in the Knowledge Base (KB) article Cross-linked or incorrect notes indexes in Microsoft Great Plains (KB 872678) (Not available). This will ensure that the Note Index values used are higher than any existing values. The FindMaxNoteIndex.sql script from this KB is also attached to the bottom of this post.
Should you make regular use of the sample company Fabrikam (TWO database), I would also suggest running the FindMaxNoteIndex.sql script on this database as well. This is especially worthwhile if you have third party products that have added sample data.
The AssignNoteIndex.sql script and the FindMaxNoteIndex.sql script are available from the attachment at the bottom of this post. They can be executed against any company database.
For other posts on the topic of Notes and OLE Attachments see the following posts:
- Understanding Notes and the Note Index field
- OLE Attachments and Record Notes
- All about the Dexterity OLE Container
- Copying Record Notes and OLE Attachments between Companies
I hope you find these scripts useful.
David
02-Oct-2020: Added missing zip file back to article.
08-Jun-2022: Fixed broken link to KB 872678 (Thanks Tyler for pointing that out).
This article was originally posted on the Developing for Dynamics GP Blog and has been reposted on http://www.winthropdc.com/blog.
Posting from DynamicAccounting.net
http://msdynamicsgp.blogspot.com/2010/02/fixing-note-index-values-in-dynamics-gp.html
LikeLike
Posting from Mohammad Daoud
http://mohdaoud.blogspot.com/2010/02/note-id-has-not-been-set.html
LikeLike
Posting from Sivakumar Venkataraman
http://cvakumar.com/msdynamics/2010/03/01/updating-missing-note-indexes-in-tables/
LikeLike
Hello,
Is there any way to create a note on an invoice using the web services?
We need to use the web services to add some notes to the invoice. I have searched a lot but couldn't find a way to do so. Can you please guide me to a way to do so?
Do I need to handle it using OLE or so? or do I need to set a certain property in PayablesInvoice instance before sending it to the CreatePayablesInvoice webservice method? or there is another method to add a note to any GP entry? Please advice.
Thanks!
LikeLike
Hi Mohammed
Blog comments should not be used for technical support. I would suggest using the forums, but I think you already did:
social.microsoft.com/…/0572e941-e96a-4e0c-977d-9d0470be000d
Hopefully Chris' answer is what you needed.
David
LikeLike
David,
I want to thank you for the post. I've tweaked SQL Note Index Scripts to fix duplicate NOTEINDX values in FA00100 table.
LikeLike
Hi there Dave!
You have yet again put together something that really helps clients that are in a bind, especially those that experienced issues with modules that are not supported by Notefix. Good one! Keep up the great job that you are doing and I do hope that you will get more recognition on your work!!
Mielyn N.
LikeLike
anyone experience customer notes disappearing?
LikeLike
There was a problem with the error message but the source of the problem was the Numerical series in the receivables module options. Since the number was invalid, the note assigned to it was always “0”. By reestablishing the numerical series, the problem disappeared
LikeLike
Hi David,
I could not find the AssignNoteIndex.sql script.
Is it still available?
Thank you.
LikeLiked by 1 person
Hi Diego.
I uploaded the missing file. Thanks for pointing that out.
David
LikeLike
Hey David
Just a heads up
Your link to the KB is missing the last number. Your text is good but the actual link is badhttp://support.microsoft.com/kb/87267 vs http://support.microsoft.com/kb/872678
You’re doing amazing work thanks for the post.
LikeLiked by 1 person
Thanks Tyler. Fixed now.
LikeLike