Skip to main content

Notifications

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

  • Mark Ehleben Profile Picture
    55 on at
    Re: Re: Re: Re: VBTools-How to update a grid with LUpd info

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

  • Jason Irvan Profile Picture
    180 on at
    Re: Re: Re: VBTools-How to update a grid with LUpd info

    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
    Re: Re: VBTools-How to update a grid with LUpd info

    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
    Re: VBTools-How to update a grid with LUpd info

    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().

     

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March 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... 294,120 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans