web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Document Attach Issue

(0) ShareShare
ReportReport
Posted on by

We are currently trying to setup document attach in Dynamics GP 2015 R2.  Unfortunately, the only user that can attach documents is the 'sa' account with all the others generating the following error:  "a save operation in table 'coAttachMSTR' has created a duplicate key"  This error comes up when trying to create a new attachment.  When trying to view an attachment from a user other than 'sa' we get 'Unable to preview this attachment".  I have tried reviewing all security options and rebuilding the table but no luck.  Any thoughts?DA_5F00_Issue.jpg

*This post is locked for comments

I have the same question (0)
  • Mahmoud Saadi Profile Picture
    32,738 on at

    The issue has been reported recently, and the solution for this specific case relies in the ODBC. Check this out A save operation on table 'coAttachMSTR' has created a duplicate key"

    Your feedback is highly appreciated,

  • Community Member Profile Picture
    on at

    Mahmoud, this does NOT resolve the issue in 2015 R2...  The user account 'sa' can attach and preview documents without issue but no other user account can do either.  That leads me to believe it is a permission error somewhere but a review of the DexSQL log shows a duplicate key being created but the key is blank.  Bug?

    I tried reinstalling Dex Shared Components, reviewed the odbc settings at each station and nothing changes.

  • Community Member Profile Picture
    on at

    UPDATE:  It appears the attachments being made by users other than SA are coming in with a blank Attachment_ID...  Not sure why this is happening but once a user adds a document that null ID is taken and no user can attach again.  Is this a setting somewhere or a bug?

  • Mahmoud Saadi Profile Picture
    32,738 on at

    I have just tested this on my test environment with the exact same error you mentioned, only the "sa" user is able to attach documents while all other users are failing to do so, getting the same error

    Following this issue on the SQL level, I can clearly see that this is not a permission issue since I granted the test user a "Sysadmin" role, tried the Grant.sql script and still getting this error.

    As retrieved from the SQL profiler, the 'sa' user is getting the attachment ID properly, and then getting it inserted into the CO00100 (procedure zDP_CO00101SI ),

    -- The code below is retrieving the Attachment ID
    
    EXEC sp_executesql N'INSERT INTO coAttachmentItems (Attachment_ID, fileName, BinaryBlob) VALUES (@Attachment_ID, @fileName, 0x0) ',
        N'@Attachment_ID nvarchar(36),@fileName nvarchar(6)',
        @Attachment_ID = N'7e063e4d-4d5c-4c14-9337-70d0a15a337a',
        @fileName = N'12.mac'
    go
    
    -- The code below is inserting the record into CO00100 including the attachmentID 
    
    BEGIN
        DECLARE @num INT
        EXEC FIVER.dbo.zDP_CO00101SI '7e063e4d-4d5c-4c14-9337-70d0a15a337a',
            '12.mac', '', 'sa', '2017.04.12', '03:12:37', 'IC', 0, 0, 0, '', 0, 0,
            @num OUT
        SELECT  @num
    END 


    On the other hand, the other test user is not retrieving any attachmentID, and the field is blank as shown below:

    BEGIN
        DECLARE @num INT
        EXEC FIVER.dbo.zDP_CO00101SI '', '12.mac', '', 'USER15', '2017.04.12',
            '03:07:48', 'IC', 0, 0, 0, '', 0, 0, @num OUT
        SELECT  @num
    END 

    As you see, the first parameter which is the AttachmentID is blank, and that's why the error is poping on the screen.

    This shall be reported to Microsoft in order to check and provide a relevant solution.

    Meanwhile, I will be testing different scenarios trying to get a work around solution (if possible)

    Derek Albaugh Would you take a look at this issue in 2015 R2 ? It seems as a quality issue.

    Your feedback is highly appreciated,

  • Community Member Profile Picture
    on at

    We have the same issue - after upgrading from GP2010 we cannot see our currently attached OLE notes either .  The OLE container is a blank box!

  • Almas Mahfooz Profile Picture
    11,009 User Group Leader on at

    community.dynamics.com/.../118691

    Oops, sorry guys I was not having the post and after hitting answer come to know this link is already shared.

    Just wondering, am I working slow today or my system. :(

  • Mahmoud Saadi Profile Picture
    32,738 on at

    I have reported the issue on MSConnect, waiting for an official response from Microsoft Support Team

    GP 2015 R2, Document Attachment Error "A Save Operation on table 'coAttachMSTR' has created a duplicate key

    Will be updating this thread once a response is provided,

  • Community Member Profile Picture
    on at

    The last response I saw showed 'resolved' with a Microsoft employee stating "Thank you for your suggestion. We will consider this functionality for a future release. ".  I think this might need to get re-submitted since someone did not fully review the issue.

  • Community Member Profile Picture
    on at

    check the coAttachMSTR table. I believe, an record created by the "sa" user was causing this issue for the other users. Move your live company data into the test company and try removing that record.

    Note: Do it in your test environment and if it solves your problem replicate the same to your live environment.

  • Community Member Profile Picture
    on at

    Shan, the sa user is the only user that can create valid records.  The issue is with users other than sa, regardless of permissions, who attempt to attach or view a record.  Something is occurring within GP that is not passing any attachment ID and leaving a null value for the attachment_id key.  I believe this is happening because of a security piece not properly updating when upgrading from a prior version of GP.  Please review Mahmoud's detailed response above.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans