Differences
This shows you the differences between two versions of the page.
customization:limiting-feature-access [2016-03-08 12:45] Martin Berg Page moved from relnotes:releases:customization:limiting-feature-access to customization:limiting-feature-access |
customization:limiting-feature-access [2018-12-02 22:09] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Limiting access to features ====== | ||
- | ===== Prevent mass updates ===== | ||
- | Before the //Mass update// menu is shown a VBA event is triggered that allows customization of which fields or objects that can be updated or created. This event also receives information of which fields or objects that the user wants to update. The event has the following signature: | ||
- | < | ||
- | |||
- | '' | ||
- | |||
- | '' | ||
- | ; TargetClass : An object of type LDE.IClass which spcifies the class of the record to create. | ||
- | ; SourceClass : An object of type LDE.IClass which specifies the class used as source which the new record should be linked to. | ||
- | | ||
- | '' | ||
- | |||
- | The following example makes sure it's only allowed to mass update fields beginning with the letter " | ||
- | |||
- | <code vb> | ||
- | Private Sub Explorer_BeforeCommand(Command As CommandEnum, | ||
- | |||
- | ' Verify that it's the right command | ||
- | If Command <> lkCommandUpdateOption Then Exit Sub | ||
- | |||
- | ' Is it a field that is being updated? | ||
- | If TypeOf Parameter Is LDE.Field Then | ||
- | If Left(Parameter.LocalName, | ||
- | Cancel = True | ||
- | End If | ||
- | End If | ||
- | | ||
- | End Sub | ||
- | </ | ||
- | |||
- | ===== Prevent Excel export ===== | ||
- | Before and after certain commands are executed in LIME Pro, VBA events that can be listened to are triggered. These events are named '' | ||
- | |||
- | The following example disables usage of the //Export to Excel// feature: | ||
- | |||
- | <code vb> | ||
- | Private WithEvents m_Explorer As Lime.Explorer | ||
- | |||
- | Private Sub Application_AfterActiveExplorerChanged() | ||
- | Set m_Explorer = Application.ActiveExplorer | ||
- | End Sub | ||
- | |||
- | Private Sub m_Explorer_BeforeCommand(ByVal Command As CommandEnum, | ||
- | If Command = lkCommandExportToExcel Then | ||
- | | ||
- | | ||
- | End If | ||
- | End Sub | ||
- | </ | ||
- | |||
- | ===== Hiding inspector toolbar buttons ===== | ||
- | It is possible to hide certain buttons in the explorer toolbar by modifing the '' | ||
- | |||
- | <code vb> | ||
- | Private WithEvents m_Inspector As Lime.Inspector | ||
- | |||
- | Private Sub Application_BeforeActiveInspectorChanged(ByVal NextInspector As IInspector) | ||
- | Set m_Inspector = NextInspector | ||
- | End Sub | ||
- | |||
- | Private Sub m_Inspector_BeforeShow(Cancel As Boolean) | ||
- | If m_Inspector.Explorers.Exists(" | ||
- | | ||
- | End If | ||
- | End Sub | ||
- | </ | ||
- | |||
- | The following buttons can be modified: | ||
- | |||
- | ^ Identifier ^ Button ^ | ||
- | | '' | ||
- | | '' | ||
- | | '' | ||
- | | '' | ||
- | | '' | ||
- | |||
- | To show the button set the value to '' | ||
- | |||
- | ===== Prevent hiding of tabs and fields ===== | ||
- | Users may normally individually configure which fields and tabs that are visible. To prevent this behavior the following VBA code can be used: | ||
- | |||
- | <code vb> | ||
- | Application.Database.Settings.Item(" | ||
- | </ | ||
- | |||
- | This can also be done for a specific database class, //company// in this case: | ||
- | |||
- | <code vb> | ||
- | Application.Database.Settings.Item(" | ||
- | </ | ||
- | |||
- | <WRAP round info> | ||
- | === Note === | ||
- | If users have already used the show/hide fields/tabs feature there is a risk that they have already hidden tabs and/or fields and then after disabling the feature will not be able to restore the visibility settings. | ||
- | </ |