exec DYNAMICS.[dbo].[smGetNextNoteIndex] @I_sCompanyID, 1, @O_mNoteIndex output, @O_iErrorState output
Again, note much of an explanation along with this, I'm just blogging this stored procedure call so I don't lose it.
We index all these stored procedures on theSQL for Dynamics menu, here.
This system proc will get the next available note index.
I found a good explanation here: http://blogs.msdn.com/b/developingfordynamicsgp/archive/2009/06/03/understanding-notes-and-the-note-index-field.aspx