Unchecking Associate LOV's

Is there anyway in designer to uncheck the Associate List of Values for all objects in the universe besides going to each objects individually?


KennyBo :uk: (BOB member since 2010-07-13)

I am afraid you have to do it manually.


Marfi :poland: (BOB member since 2006-12-18)

Here’s a sample VBA script that will remove the LOV setting from all objects in parent classes. It does not handle subclasses at the moment.

Option Explicit                 ' Require variables to be declared before being used
                                ' always a good practice
                                
Option Base 1                   ' Start array indexes at 1 as I think better that way

Dim boDesignerApp As Designer.Application
Dim boUniv As Designer.Universe

Sub Main()
    
    Call RemoveLOV
    MsgBox ("Done")
    
End Sub

Private Sub RemoveLOV()

    ' Establish a Designer session and log in
    Set boDesignerApp = New Designer.Application
    boDesignerApp.Visible = True
    
    ' Use this method instead for older versions
    ' Call boDesignerApp.LoginAs
    Call boDesignerApp.LogonDialog
    
    Set boUniv = boDesignerApp.Universes.Open
    
    boDesignerApp.Visible = False
    
    Dim obj As Designer.Object
    Dim cls As Designer.Class
    
    For Each cls In boUniv.Classes
        For Each obj In cls.Objects
            If obj.HasListOfValues = True Then
                obj.HasListOfValues = False
            End If
        Next obj
    Next cls
        
    boUniv.Save
    
    ' Release the Designer app and recover memory
    boDesignerApp.Quit
    Set boDesignerApp = Nothing

End Sub

If you are familiar with VBA code, then all you have to do is enter this code into an Excel workbook, establish the reference to the proper libraries, and run the macro. It will start Designer, prompt you to log in, let you select the universe, remove all of the “has LOV” checkboxes that are not already clear, and then save the universe. Test on a copy first.

If you’re not familiar with the above, I will probably post this on my blog shortly once I get the sub-class loop added to the logic.


Dave Rathbun :us: (BOB member since 2002-06-06)

Thanks for the VBA code Dave. I was able to use it and it worked successfully.


KennyBo :uk: (BOB member since 2010-07-13)

Hi

I`ve been told the standard rule is to not associate a list of values to an object unless it is really required. Therefore I have 2 questions:

  1. Why is this reasoning? Does it affect performance if lists of values are attached to objects?

  2. If the “good practice” is to NOT have list of values, why is the default set up including LOV automatically? Is there a way to change this, so new objects dont come with LOV unless you do it manually?

Thanks for your input

David


bulgaru10 :malta: (BOB member since 2006-12-15)