Fixing missing Note Index values


David Meego - Click for blog homepageA 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) Secure Link. 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

SQL Note Index Scripts.zip

Comments (9)

  1. Mohammed Nour says:

    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!

  2. David Musgrave says:

    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

  3. Lev Z says:

    David,

    I want to thank you for the post. I've tweaked SQL Note Index Scripts to fix duplicate NOTEINDX values in FA00100 table.

  4. Mielyn says:

    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.

  5. Sue Peluso says:

    anyone experience customer notes disappearing?

  6. Dominic says:

    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