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)

VBTools-How to update a grid with LUpd info

(0) ShareShare
ReportReport
Posted on by 55

What's the preferred approach in VBTools to update a detail level (grid) with the LUpd_DateTime, LUpd_Prog, & LUpd_User info?  I tried the sample code below (I found it elsewhere in a search), but it does not seem to update the table (data remains unchanged).

Private Sub Update1_Update(Level As Integer, InsertFlg As Integer, LevelsDone As Integer, LevelsLeft As Integer, retval As Integer)
   
    Select Case Level
        Case 0 (header level)
            bxtPORqHdr.LUpd_DateTime = bPES.Today
            bxtPORqHdr.LUpd_Prog = bPES.ScrnNbr
            bxtPORqHdr.LUpd_User = bPES.UserId
       
        Case 1 (grid Level)
            bxpmsetup.LUpd_DateTime = bPES.Today
            bxpmsetup.LUpd_Prog = bPES.ScrnNbr
            bxpmsetup.LUpd_User = bPES.UserId
           
    End Select
   
End Sub

I've confirmed via Call MessBox() that I'm obtaining the right data, but the table update does not work.  No error messages or issues, just no table updates.

 Thanks.

*This post is locked for comments

I have the same question (0)
  • Jason Irvan Profile Picture
    180 on at

    Assuming those fields are in the cursor but not actually bound to controls in the grid, I believe you have to use SetBufferValue() to update them. Direct access only works if the fields are bound to controls in the grid.

    The SetBufferValue() page in the Visual basic for applications help file on your client has a good explanation of this.

     If it is on the grid try using SetObjectValue().

     

     

  • Mark Ehleben Profile Picture
    55 on at

    Jason, I'm using the VBTools set to build a new screen, not using VBA via Customization Manager.  Call SetBufferValue() is valid in VBA and BSL, but is not recognized as a valid function in VBT.  Strange thing is, when I use the sample code on LEVEL0, the table gets updated, but not on the LEVEL1 (grid).

  • Jason Irvan Profile Picture
    180 on at

    Ah sorry I misunderstood. Then call SUpdate1 on the Level1 Cursor and then call MDisplay on the grid control as well to refresh the grid with the current data.

    The SAF_grid control in a detail few makes data access a little more complex. Level0 is getting updated because it's just a single record in the level0 cursor with controls. 

     If that doesn't work, I have some code I can modify in a test project and share with you.

    Jason

     

     

     

     

      

  • Mark Ehleben Profile Picture
    55 on at

    Your post unlocked my brain freeze, and I realized that adding the MUpdate() call to my update event was the missing link!!!!  Thanks.

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