Filtering Via VB.NET


Here’s another simple example of how to do something. I am creating a custom job release procedure at the moment as we want to swap components on boms depending on a specific set of circumstances. The form currently looks like this (it is in development remember – not too user friendly yet!)

Change Job Status Form

Change Job Status Form

I have created a view for the data that appears in the grid, then created an IDO off of that, which is not 100% necessary, but I tend to find the occasions when I don’t do it, I need it some time later!

I want the user to be able to filter, but filter easily without having to use F4’s etc. The target audience for this form is production staff who are more familiar with data collection forms., therefore what I have implemented is a drop down list of job prefixes as we use different prefixes for different operational stages as shown here :-

jobfilter

Now, whenever the user changes this field it updates the results / data shown in the grid. To do this, firstly you need to add a event handler to the “Data Change” Property of the combo box as shown here :-

datachangeproperty

This is then lined to a form script which looks like this :-

Sub PBTI_JobFilter()
If ThisForm.Components(“PBTI_COMBO_JobFilter”).Value.ToUpper = “ALL” Then
ThisForm.PrimaryIDOCollection.Filter = “”

Else
ThisForm.PrimaryIDOCollection.Filter = “job Like ‘” + ThisForm.Components(“PBTI_COMBO_JobFilter”).Value.ToUpper + “%'”
End If

ThisForm.PrimaryIDOCollection.Refresh()

End Sub

The list source for the combo box is an inline list at the moment as shown here:-

Infor Syteline List Source Inline

Infor Syteline List Source Inline

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.