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 SL (Archived)

Limit of 50 cursors has been reached

(0) ShareShare
ReportReport
Posted on by 641

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

I have the same question (0)
  • Verified answer
    Ram Peru Profile Picture
    2,830 on at

    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.

  • Lewis Shaw Profile Picture
    641 on at

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

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 SL (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans