18 November 2008
Filter Dynamics GP Lookups Using VBA
Guys,
A got allot of mails requesting to have Item Security functionality to distribute sites items and show only certain items for the warehouse keeper.
For those who are looking for such functionality, you need to follow the steps below:
1. Create a new table in the database that contains “User ID”, “Item Number” fields. This table will hold the items that will be mapped to each user.
2. Add “Items Lookup” form to VBA and include Item Number field.
3. Get the current connected user from Globals.
4. Loop the following code on all the items returned for the logged user:
Private Sub Grid_BeforeLinePopulate(RejectLine As Boolean)
If ItemNumber.Value “Does not exist in our table” Then
RejectLine = True
End If
End Sub
Please let me know if you may need any help, this code is applicable for all lookup forms and details windows.
Comment Notification
If you would like to receive an email when updates are made to this post, please register here
Subscribe to this post's comments using
Comment Policy: No HTML allowed. URIs and line breaks are converted automatically. Your e–mail address will not show up on any public page.