Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

Saving to a custom table receiveds error Programming Bulletproof Error 10262

(0) ShareShare
ReportReport
Posted on by

I've added a custom table to the Dynamics SL AR Invoice and Memo screen and it displays, updates but does not insert new records. When the screen inserts a new ARDoc row, I receive the following:

Programming Bulletproof Error 10262

Invalid cursor value passed to sinsert1(). Please make sure cursor value is greater than 0. Also verify that this cursor has been passed to sql().

I did the work around of performing a select to initialize the cursor to get a non-zero value for the cursor but then it seems the cursor becomes SqlReadOnly (per the following error) instead of the SqlList flag that it was created.

System Message 10091

Cursor specified SqlReadOnly flag.

Function: sinsert(DefaultCreated)

Level: NOLEVEL

Tables(s): xMSOTCARDoc

Sql: Select * from xMSOTCARDoc where BatNbr = '007797' and RefNbr = '001896'

Should I do a work around to do an Update statement instead of a Select or what is the real way to keep the cursor initialized to allow updates, inserts and selects?

Dynamics SL 2011 FP1

*This post is locked for comments

  • Apps Mexico Profile Picture
    1,090 on at
    RE: Saving to a custom table receiveds error Programming Bulletproof Error 10262

    Yes, actually the sqlcursorex is the best way for aditional tables, the key of the solution is the SqlFetch1 that is before SInsert or SUpdate, that allows to the kernel know about the what is the row that have to insert or update. The t structure is to avoid lose all the data that is stored on the buffer (b structure).

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Saving to a custom table receiveds error Programming Bulletproof Error 10262

    Turns out that in previous versions of SL, I've used SlCursorEx with NOLEVEL + SqlUpdate or other additions. Seems to work well in SL 2011 with just  NOLEVEL.

    Call SqlCursorEx(csrxMSOTCARDoc, NOLEVEL, "csrxMSOTCARDoc", "xMSOTCARDoc", "xMSOTCARDoc")

  • Community Member Profile Picture
    on at
    RE: Saving to a custom table receiveds error Programming Bulletproof Error 10262

    I'll try those variations.

    I had used SqlCursorEx instead of SlCursor.

    I see that you are using a temporary structure tSoshipHeadDAd for the fetch.

  • Verified answer
    Apps Mexico Profile Picture
    1,090 on at
    RE: Saving to a custom table receiveds error Programming Bulletproof Error 10262

    Try this, just replace SoshipHeadAd to xMSOTCARDoc:

    Private Sub Form1_Load()

       Call SetAddr(NOLEVEL, "bSoshipHeadDAd", bSoshipHeadDAd, nSoshipHeadDAd, LenB(bSoshipHeadDAd))

       Call SqlCursor(CSR_SoshipHeadDAd, NOLEVEL)

    End Sub

    Private Sub Update1_OnUpdate(Level As Integer, InsertFlg As Integer, retval As Integer)

    serr2 = SqlFetch1(CSR_SoshipHeadDAd, "xSPSoshipHeadDAd_All" & SParm(sShipperID) & SParm("%"), tSoshipHeadDAd, LenB(tSoshipHeadDAd))

                           If serr2 = NOTFOUND Then

                               Call SInsert1(CSR_SoshipHeadDAd, "SoshipHeadDAd", bSoshipHeadDAd, LenB(bSoshipHeadDAd))

                           End If

    End Sub

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,280 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,034 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans