Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics SL (Archived)

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

(0) ShareShare
ReportReport
Posted on by

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Populate DSL grid on custom (.Net) SL screen.

    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

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Populate DSL grid on custom (.Net) SL screen.

    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.

  • Srinath N S Profile Picture
    Srinath N S on at
    RE: Populate DSL grid on custom (.Net) SL screen.

    Thanks Ayuni, that helped a lot.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Populate DSL grid on custom (.Net) SL screen.

    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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans