web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

Populate DSL grid on custom (.Net) SL screen.

(0) ShareShare
ReportReport
Posted on by 2

Hi Guys, 

I'm new to SL customization and I need some help from the experts on this community.

I've a SL custom screen where in there is one master field and one DSL grid. 
Scenario: On user entering value into the master field field (by selecting F3 and selecting a value from the list), I need to populate values in the below grid. This grid need to be populated from a custom table in the SL DB.

Right now I'm trying to use PVChkFetch1 to populate the grid, but it isn't working. Not sure how to go about it now.

Any suggestions/examples on how to do this would be great. 

Thanks all!

Regards,

Srinath

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi Srinath,

    First of all, you need to make sure your grid DBNav properties is write to receive parameter from the master field. Example:

    - select * from Custom_Table where xField like @Master_FieldName

    - Notes: please set Parm1 as your master field FieldName

    Then, under Master_FieldName_Chk function, you try write code as below:

               Dim mySQL As String

               Dim myCSR As Integer

               Dim mySERR As Integer

               Dim iFlag As Integer

               mySERR = MFirst(memhandle, iFlag)

               mySQL = "Select * from Custom_Table where xField = " & SParm(Master_FieldName)

               mySERR = SqlFetch1(myCSR, mySQL, bCustom_Table)

               If mySERR <> NOTFOUND Then

                   Call MClear(memhandle)

                   Call MDisplay(memhandle)

                   While mySERR <> NOTFOUND

                       bTable.Field1 = bCustom_Table.Field1

                       bTable.Field2 = bCustom_Table.Field2

       bTable.Field3 = bCustom_Table.Field3

                       Call MInsert(memhandle)

                       Call MUpdate(memhandle)                    

                       mySERR = SFetch1(myCSR, bCustom_Table)

                   End While

               Else

                   Call MessBox("No record found.", vbExclamation, "No Record")

                   Call MClear(memhandle)

                   Exit Sub

               End If

               Call SqlFree(myCSR)

       Call MDisplay(memhandle)

    Hope this will give you some help.

  • Srinath N S Profile Picture
    2 on at

    Thanks Ayuni, that helped a lot.

  • Suggested answer
    Community Member Profile Picture
    on at

    Assuming the selection field is in the header, the easiest way to do this is to execute Call DetailLoad(xxxxxx) where xxxxxx is the name of your SAFGrid.  Execute this after you verify the item selected.  I am assuming that the DBNAV on the grid control uses the contents of the selected field as its filter.

  • Community Member Profile Picture
    on at

    Hi ayuni, I was wondering if you can dumb down you answer since I'm just fresh out school and I'm not familiar with the sdk enviroment. This is my first job as a visual basic programer and I'm having a hard time just populating my grid.  Thank You

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics SL (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans