Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics SL (Archived)

Limit of 50 cursors has been reached

(0) ShareShare
ReportReport
Posted on by 635

I have a user that is experiencing an error saying that the limit of 50 cursors has been reached in the Voucher and Adjustment Entry screen (03.010.00) when she copies/pastes more then 25 lines from an excel spreadsheet.  The "user1" field has been added to the screen and seems to be causing the issue. If the user 1 field is left blank all 50 lines can be pasted correctly, however if more then 13 of the "user1" fields are filled out on the various lines then the error will pop-up and close the screen. 

 

Has anyone else has a similar issue with this screen? It appears that this issue is common with the latest Dynamics 2011 SP2 but I couldn't find a hotfix for it.

 

Thanks

*This post is locked for comments

  • Lewis Shaw Profile Picture
    Lewis Shaw 635 on at
    RE: Limit of 50 cursors has been reached

    Thanks, this solved our issue. The customization was missing the SqlFree call.

  • Verified answer
    Ram Peru Profile Picture
    Ram Peru 2,830 on at
    RE: Limit of 50 cursors has been reached

    Hello Lewis Shaw,

    I believe that you have faced the same issue that mentioned in the below picture.

    If yes, Please check your code for the temporary cursor that has been used in the spread1_Line check event & user1 field check event.

    Below code is the sample instance for you.

    Private Sub Spread1_LineChk (action As Integer, maintflg As Integer, retval As Integer)

    Dim SqlStr As String

    Dim Csr_Temp As Integer

    SqlStr = " Select * from Account Where Acct =  " & SParm(Trim(GetObjectValue("cacct")))

    serr1 = SqlFetch1(Csr_Temp, SqlStr, bAccount, LenB(bAccount))

    End Sub

    Dim Csr_Temp as Integer is the temporary cursor which is declared inside of the Spread1_Linechk event. Instead you can use the Global cursors like C1, C2 and C3 that already predefined cursors in VBTOOLS_VBA (refer under modules in Customization Mode).

    If you used the temporary cursors in your VBA code, you have to set free that cursor using SqlFree API. If you haven’t do the set free of temporary cursor, the cursor still remains open state since the Standard SL only allows 50 open cursors.

    Call SqlFree (Csr_Temp)

    Since you are doing the copy & paste of 50 or more than 50 records from the excel sheet into the Grid, this raised the error situation.

    Private Sub Spread1_LineChk (action As Integer, maintflg As Integer, retval As Integer)

    Dim SqlStr As String

    Dim Csr_Temp As Integer

    SqlStr = " Select * from Account Where Acct =  " & SParm (Trim(GetObjectValue("cacct")))

    serr1 = SqlFetch1 (Csr_Temp, SqlStr, bAccount, LenB(bAccount))

    Call SqlFree (Csr_Temp)

    End Sub


    Hope this explains.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans