Public Sub LoopGLProjects()



   Dim oProjects As CGLProjects

   Set oProjects = New CGLProjects

   oProjects.Init FE_Application.SessionContext

   

   Dim oProject As CGLProject

   

   Dim oProjRestrict As CGLProjAcctRestrict

   Dim oMeta As IBBMetaField

   

   For Each oProject In oProjects

           

       Set oMeta = oProject

       Set oProjRestrict = oMeta.ChildObject(GLPROJECTS_child_ACCTRESTRICTIONS)

       

       If oProjRestrict.AccountIsRestricted("03-1000-00") = False Then

              Debug.Print oProject.Fields(GLPROJECTS_fld_PROJECTID) & " - " & oProjRestrict.Fields(GLPROJACCTRESTRICTS_fld_MODE)

       End If

       

       oProject.CloseDown

   Next oProject

   

   oProjects.CloseDown

   Set oProjects = Nothing

   

   Set oProject = Nothing

   Set oMeta = Nothing

   Set oProjRestrict = Nothing

   

End Sub

Disclaimer: We provide programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes you are familiar with Microsoft Visual Basic and the tools used to create and debug procedures. Our Customer Support can help explain the functionality of a particular procedure, but we will not modify, or assist you with modifying, these examples to provide additional functionality. If you are interested in learning more about the VBA and API modules, contact your account manager.