Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
customization:limiting-feature-access [2014-01-24 16:46]
Martin Berg
customization:limiting-feature-access [2018-12-02 22:09] (current)
Line 3: Line 3:
 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:  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: 
  
-Innan Lime visar menyn Massuppdatera skickar den event till VBA för att få reda på vilka fält eller objekt som kan uppdateras eller skapasDetta event skickar med det fält eller objekt som skapa uppdateras eller skapas och ser ut på följande vis:+<code>Explorer.BeforeCommand(Command As CommandEnum, Parameter As Variant, Cancel As Boolean)</code>
  
-Explorer.BeforeCommand(Command As CommandEnum, Parameter As Variant, Cancel As Boolean) +''Command'' specifies the type of command and will have the value ''lkCommandUpdateOption'' when a mass update is about to take place.
-•Command anger typ av kommando och har värdet lkCommandUpdateOption när det rör sig av massuppdatering.+
  
-Parameter varierar i typ och beror på vad som ska massuppdateras. +''Parameter'' varies in type and depends on what is to be mass updatedWhen the target is a field an object of the type ''LDE.Field'' is passed and specifies which field to updateWhen new records are to be created the data type will be ''LDE.IProperties'' and the object will contain the following named parameters: 
-När ett fält ska massuppdateras är Parameter ett objekt typen LDE.Field och anger helt vilket fält det gäller. +  ; 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. 
-När nya objekt ska skapas är Parameter ett objekt av typen LDE.IProperties och innehåller namngivna parametrar. +   
-TargetClass är ett objekt av typen LDE.IClass och anger typ av objekt som ska skapas+''Cancel'' is a flag that determines whether or not the tab should be visible in the menu or not. When set to ''False'' (default) the tab will be added to the menu, otherwise not.
-SourceClass är objekt av typen LDE.IClass och anger typ av objekt som används som datakälla och som de nya objektet ska kopplas till.+
  
-•Cancel som är flagga som låter dig bestämma om fliken ska visas i menyn eller inte. Sätter du den till False (vilket är standardvärdet för de flikar Lime visar som standard) så läggs fliken till i menyn annars inte. +The following example makes sure it's only allowed to mass update fields beginning with the letter "A":
- +
-Följande exempel låter användarna uppdatera standardflikarna plus personfliken från företagslistan:+
  
 <code vb> <code vb>
 Private Sub Explorer_BeforeCommand(Command As CommandEnum, Parameter As Variant, Cancel As Boolean) Private Sub Explorer_BeforeCommand(Command As CommandEnum, Parameter As Variant, Cancel As Boolean)
-  + 
- ' Kontrollera att det är rätt kommando +  Verify that it's the right command 
- If Command lkCommandUpdateOption Then +  If Command <> lkCommandUpdateOption Then Exit Sub 
-  + 
-    Gäller det fält +  Is it a field that is being updated? 
-     If TypeOf Parameter Is LDE.Field Then +  If TypeOf Parameter Is LDE.Field Then 
-          +      If Left(Parameter.LocalName, 1) = "A" Then 
-        ' Tillåt inte fält som börjar på A +        Cancel = True 
-          If Left(Parameter.LocalName, 1) = "A" Then +      End If 
-                 Cancel = True +  End If 
-          End If +  
-  +
-      ' Gäller det nya objekt +
-    If TypeOf Parameter Is LDE.Properties Then           +
-  +
-           ' Kontrollera att vi utgår från företagsfliken +
-           If Parameter.Get("SourceClass").LocalName = "Företag" Then +
-  +
-              ' Ändra inte flaggan för standardflikar +
-              If Cancel = True Then +
-          +
-                       ' Tillåt om det är personfliken +
-                  If Parameter.Get("TargetClass").LocalName = "Person" Then +
-                      Cancel = False +
-                  End If +
-             End If +
-         End If +
-     End If +
- End If+
 End Sub End Sub
 </code> </code>
  
 ===== Prevent Excel export ===== ===== 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 ''Explorer_BeforeCommand'' and ''Explorer_AfterCommand''.+Before and after certain commands are executed in Lime CRM, VBA events that can be listened to are triggered. These events are named ''Explorer_BeforeCommand'' and ''Explorer_AfterCommand''.
  
 The following example disables usage of the //Export to Excel// feature: The following example disables usage of the //Export to Excel// feature:
  • Last modified: 6 years ago
  • (external edit)