Tuesday, November 18, 2008

Filter Dynamics GP Lookups Using VBA


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.

Mohammad R. Daoud
Software Development Manager
+962 - 79 - 999 65 85
Dynamics Innovations

No comments:

Related Posts:

Related Posts with Thumbnails