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)

Deleting Record from Memory Array

(0) ShareShare
ReportReport
Posted on by

I'm trying to compare records in a memory array for a grid to a specific criteria.  If they don't match, I use the MDelete function to remove the record from the memory  array.  When I have looped through all the records, I use MFirst to move to the first record, and then MDisplay to refresh the contents of the memory array on the grid.  However, while it does correctly identify the records that need to be removed, and does not give an error when using the MDelete function, when I use the MDisplay to show the records, all the records are still present, including the ones that should have been removed.  Here is the code I"m using:

Private Sub cmdRefresh_Click()
mem_Detail = GetGridHandle("SafGrid1")
If Trim(CreditSite) <> "" Then
Dim User8 As String
Dim OrdNbr As String
  serr1 = MFirst(mem_Detail, MemMaintFlg)
      
     While (serr1 = 0)
       
        'check value of User8
        Call GetBufferValue("bsoheader.User8", User8)
       If Trim(User8) = Trim(CreditSite) Then
       'go on to the next record      
               serr1 = MNext(mem_Detail, MemMaintFlg)
        Else
              'delete this record from memory array

              RecFetch = MDelete(mem_Detail, MemMaintFlg)
        End If

      Wend
      serr1 = MFirst(mem_Detail, MemMaintFlg)

      Call MDisplay(mem_Detail)
      
 End If
 
End Sub

Any thoughts or suggestions on what I'm doing wrong?  Thanks in advance.

*This post is locked for comments

I have the same question (0)

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