Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

smGetNextNoteIndex and creating new note

Posted on by 70

I have procedure which makes new note. It basically consists of three steps:

1. Call DYNAMICS.[dbo].[smGetNextNoteIndex] to get new note index

2. Call [dbo].[zDP_CN00100SI]

3. Make INSERT INTO dbo.CN00300

This procedure is called from external application in a loop (up to 10K calls). All is working fine until the application is the only process which modifies notes.

But, if in the same time, user opens GP, goes into Sales -> Collection Main, queries for some records and clicks on “New Note” – then GP shows error message “GetNoteIndex returned an existing CN_Note_Text record index. Getting new index.”.

If to ignore it and try to save new note, other error is occurred: “A save operation on table ‘CN_Notes_Text’ has created a duplicate key.”

I suggest that GP itself also uses smGetNextNoteIndex to get new note index, so such error cannot theoretically occur. Or am I wrong somewhere?

*This post is locked for comments

  • RE: smGetNextNoteIndex and creating new note

    yep, thanks, it's CN40101

    And a little note: table SY01500 stores the next (non used) index value, but CN40101 stores the current (already used) index value.

  • Verified answer
    Tim Foster Profile Picture
    Tim Foster 8,515 on at
    RE: smGetNextNoteIndex and creating new note

    The Note index you're looking for is in CN40101.

  • Tim Foster Profile Picture
    Tim Foster 8,515 on at
    RE: smGetNextNoteIndex and creating new note

    The post DOES contain the answer in the comments.

    smGetNextNoteIndex generates a note index for SY03900 Record Notes.

    You are inserting notes into the Collections Management Note tables, which are completely separate from GP because Collections is a third party product.

    I don't know where the Collections note Index is stored.

    Tim

  • RE: smGetNextNoteIndex and creating new note

    Thank you, but that post does not give the answer. I don't have the Cross Linked Notes problem related to databases restoring, and note index value is correct. There is no errors when actions are performed separately - I can insert thousands notes from external application (calling smGetNextNoteIndex of course), and then user can add notes from GP interface. The problem arises when user tries to use GP in the time when application runs and generates notes.

  • Tim Foster Profile Picture
    Tim Foster 8,515 on at
    RE: smGetNextNoteIndex and creating new note

    Please see:

    blogs.msdn.com/.../understanding-notes-and-the-note-index-field.aspx

    Tim

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans