Setting Read-Only on Legacy Views

Not too long ago I wrote an article on generically setting a Form as read-only on slxdeveloper.com. Mike Spragg from E1 Business shared a great approach with me to accomplish the same with legacy views.

What Mike does is run a script that establishes all the objects on the form – and then set them to disabled. That way, you retain the cut/paste info & linkedit’s (urls’ etc):

Dim ObjectName As String
Dim enabled As Boolean
Dim t As Integer

Dim IDList As String
Dim IDExclude As String

    enabled = False

    IDList = CurrentObjectChildrenNames
    IDExclude = "Panel4btMatchBevelPanel1Panel2Panel3Panel4PanelimLockButton"

    For t = 0 To GetLineCount(IDList) - 1
        Objectname = GetNthLine(IDList, t)
        If instr(1, IDExclude, ObjectName) <= 0 Then
            SetPropertyOf ObjectName, "Enabled", enabled
        End If
    Next t

This is, obviously, legacy – but same idea for active forms

IDList = list of all objects on the form
IDExclude = Any you don’t want to protect

That is an awesome approach. Thanks Mike! For anyone still working with legacy (I feel for you) this is a great way to accomplish this.

ABOUT THE AUTHOR

Ryan Farley

Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He's been blogging regularly about SalesLogix, now Infor CRM, since 2001 and believes in sharing with the community. His new passion for CRM is Creatio, formerly bpm'online. He loves C#, Javascript, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!

You have Successfully Subscribed!