Description of COM Interfaces
Product line
Standard
|Expert
Operating mode
CLOUD ABO
|ON-PREMISES
Modules
Services & CRM
Budget & Phases
Purchases
Resource Planning
Business Intelligence
An interface in the sense of COM describes the properties and features that a COM object provides.
Depending on whether the desktop app (local COM server) or the cloud app (proxy for the connection to the COM server) is addressed via COM, the interfaces have different names. However, the use is the same, the calling application does not have to make a distinction.
The interface names listed below are according to the scheme COM-Name / Proxy-Name.
All examples are written in Visual Basic.
This is the default interface of the Vertec COM server. CreateObject("Vertec.App")
returns a session reference. Other objects can be requested from IVtcSession/ComCoClass.
Dim Vertec As Object Set Vertec = CreateObject("Vertec.App")
Feature / Function | description | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ArgObject |
Returns the up-to-date object (up-to-date entry) in Vertec. This is the entry selected as the main entry in the active Vertec window. The type of the returned interface corresponds to the type of the up-to-date object. |
||||||||||||||||||||||
BeginSystemContext / EndSystemContext |
Switches Vertec to extended user rights within these two commands. Can only be applied via COM if Vertec was started with the /SUPER parameter and the administrator is logged in. Otherwise, the call will fail. |
||||||||||||||||||||||
CreateList(classname as string) |
Creates a new empty Vertec list for entries of the specified type (classname). Set Projektbearbeiter = Vertec.ArgObject Set ObjectList = Vertec.CreateList("Projektbearbeiter") ObjectList.Add Projektbearbeiter |
||||||||||||||||||||||
CreateObject(classname as string) |
Creates a new object in Vertec. The class name of the object must be passed as a parameter. As a result, the feature returns an interface reference of the newly created object. | ||||||||||||||||||||||
DisableEvents / EnableEvents |
Temporarily turns off the Event Script
system. Can only be applied via COM if Vertec has been started with the /SUPER parameter and the administrator is logged in. Otherwise, the call will fail. |
||||||||||||||||||||||
Eval(expression as string) |
This feature evaluates any OCL expression. The result is returned as a variant and can be interpreted as String, Integer, Float, Boolean, or Object, depending on the OCL expression. Caution: Eval with an OCL expression will load all the objects from the database necessary to calculate it. In some cases, this can cause performance problems or high memory consumption. GetWithSQL is preferable for querying larger quantities of the same objects. |
||||||||||||||||||||||
EvalToVariable(root as object, expression as string, varname as string) |
This allows values to be loaded into variables that can then be used in OCL expressions. For example, services should be shown from a certain point in time. Instead of searching the services in the manner “openServices->select(date >=” & encodeDate(2023, 03, 01) & “) “, you can first set a variable: Vertec.EvalToVariable Vertec.ArgObject, "encodeDate(2023,03,01)", "varVon" and then used in OCL: offeneLeistungen->select(datum >= varVon) The expression is evaluated on the specified root object. So it can also be an expression of the type: Vertec.EvalToVariable Vertec.ArgObject, "projekt.rechnungen->reject(proforma)", "Rechlist" be indicated. |
||||||||||||||||||||||
ExecuteFileReport
|
This feature can only be used while running the desktop app. It allows you to call up a Legacy Office Report .
Example call with all parameters: Set Vertec = CreateObject("Vertec.App") Set Projekt = Vertec.ArgObject Set Dok = Vertec.ExecuteFileReport("V:\Reports\Brief.dotx", Projekt, Nothing, "Brief.docx", "", "", True, False, True) To print the document, you can Dok.PrintOut be called up. |
||||||||||||||||||||||
GetObjectByID(ID: String or int) |
Returns the object with the corresponding ID. The ID must be the Internal Id ID of the object, either as a string or as an integer. Set Obj = Vertec.GetObjectByID(2880) Set Obj = Vertec.GetObjectByID("2880") If no object with this ID exists, an error is thrown. |
||||||||||||||||||||||
GetWithSQL(className as String, SQLWhere as String, SQLOrder as String) |
Returns the result of an SQL query on a specific Vertec class. This means that SQL selects all objects of a specific class according to the specified criteria (SQL Select, Where Clause) and returns them in a list. The executing user must have administrator privileges or SQL Query privileges. Unlike Eval, only the objects that match the SQL condition are loaded from the database. Example: Dim List as Object Set List = Vertec.GetWithSQL("adresseintrag", "name like 'A%'", "name") |
||||||||||||||||||||||
InputBox (title as String, Prompt as String, Default as String): String |
Displays an input dialog with title, prompt text and input field with default value.
Wert = Vertec.InputBox("Vertec", "Wie lautet Ihr Name?", "") Return values:
|
||||||||||||||||||||||
MsgBox (Prompt as String, [Buttons as int], [Title as String]): integer |
Displays a message box.
Vertec.MsgBox "Dies ist mein Text.", 1, "Titel" The return value indicates which button was clicked. This is one of the following integer values:
If a value is queried, the feature must be called with a parenthesis: Wert = Vertec.MsgBox ("Dies ist mein Text.", 1, "Vertec") If Wert = 1 then ... |
||||||||||||||||||||||
ScriptExecute(scripttext As String, argobject As Object) |
Allows a Vertec script to be invoked. The executing user must have administrative privileges or the right to execute this script.
Dim Script As Object Dim Bearbeiter As Object Dim Scripttext As String Set Bearbeiter = Vertec.User Set Script = Vertec.ArgObject Scripttext = Script.Member("scripttext") Vertec.ScriptExecute (Scripttext, Bearbeiter) |
||||||||||||||||||||||
SetObjVariable(variable name, value) |
Sets an object variable in OCL. Example: Vertec.SetObjVariable "myProjekt", proj These can then be accessed in OCL expressions via variable name: offeneLeistungen->select(projekt=myProjekt)->size The difference to EvalToVariable (see above) is that here an object is simply passed, without evaluation of an expression. |
||||||||||||||||||||||
SetResourcePlanValue(user, project, phase, date, intervalTyp, value) |
Allows you to set resource plan values via script.
Set Projektbearbeiter = Vertec.User Set Projekt = Vertec.ArgObject Vertec.SetResourcePlanValue Projektbearbeiter, Projekt, Nothing, Vertec.Eval("encodeDate(2023,04,24)"), 0, 540 |
||||||||||||||||||||||
ShowForm(obj As Object) |
Method to invoke the details window of the Vertec object passed as argument. Note that this changes the ArgObject, i.e. the up-to-date object in Vertec. Vertec.ShowForm Projekt |
||||||||||||||||||||||
Translate(text As String) As String |
Translates a text to the date interface language.
Wert = Vertec.Translate("Projektbearbeiter") |
||||||||||||||||||||||
UpdateDatabase |
Saves changes to the database and validates newly created objects. These objects are no longer invalid as long as they do not violate any rules. |
||||||||||||||||||||||
User |
Returns the up-to-date logged-in user. |
This is the default interface for all Vertec objects.
For certain objects such as projects, invoices etc. own interfaces are defined, which inherit from IVtcObject/VtcObjectProxy, i.e. the properties and features of IVtcObject/VtcObjectProxy are also present on the object interfaces.
Feature / Function | description |
---|---|
AddTag(Tagname as String) |
Adds a tag to the object. Set Projektbearbeiter = Vertec.User Projektbearbeiter.AddTag "mytag" Can be removed with RemoveTag(Name). |
AsString |
Returns the object’s default representation as a string. Set Projektbearbeiter = Vertec.User Debug.Print Projektbearbeiter.AsString -> Christoph Keller |
ClassName |
Returns the class name of the object as a string. Set Projektbearbeiter = Vertec.User Debug.Print Projektbearbeiter.ClassName -> Project users |
DefaultInterface |
Returns this for objects with special interfaces, otherwise IVtcObject/VtcObjectProxy. No longer needed, because the objects themselves are supplied as an interface, so that you can work with them directly. |
Delete |
Deletes the object in Vertec. Returns an error if the logged-in user is not authorized to delete. Set Obj = Vertec.ArgObject Obj.Delete |
Eval(expression as string) |
Evaluates an OCL expression on the object. Unlike Eval, which is called on the session (IVtcSession/ComCoClass), here the expression is applied directly to the object. Dim Projektbearbeiter as Object Dim Projektliste as Object Set Projektbearbeiter = Vertec.User Set Projektliste = Projektbearbeiter.Eval("eigProjekte") |
EvalAsString(expression as string) |
Same as Eval, but the String representation of the result is returned directly. Dim Projektbearbeiter as Object Dim Wert as String Set Projektbearbeiter = Vertec.User Wert = Projektbearbeiter.EvalAsString("stufe") |
GetMLValue(Index, Language As String) As String |
If the object contains , they can be queried with this method in the other languages.
Set Taetigkeit = Leistung.Eval("typ") Wert = Taetigkeit.GetMLValue("text", "EN") The query via Member ( The MLStrings are set via SetMLValue. |
HasTag(tag As String) As Boolean |
Query whether a specific tag exists on the object. If Projektbearbeiter.HasTag("mytag") Then 'Do Something End If The return value is 1 (True) or 0 (False). |
IsOfType(typeName As String) As Boolean |
Specifies whether the object is of the specified type (class name). Example: Set Obj = Vertec.ArgObject If Obj.IsOfType("Adresseintrag") Then Debug.Print "Ist ein Adresseintrag" End If If Obj.IsOfType("Person") Then Debug.Print "Ist sogar eine Person" End If As can be seen in the example, the entire tree is taken into account, including the base classes. |
LinkTo(target As Object, role As String) |
Makes a link (via Custom Link Type ) from the object to the target object with the specified role.
Set Person = Vertec.GetObjectById(3045) Set Firma = Vertec.GetObjectById(3174) Person.LinkTo Firma, "VR-Mandate" 'oder Person.LinkTo Firma, "vrlinktyp_A" With Unlink, the link can be released again. For detailed information, see Operators and Methods for Links. |
Member(membername: string) |
Read access to the member with the specified name. This can be either an attribute or a link (object or object list). Set Projekt = Vertec.ArgObject Set Kunde = Projekt.Member("kunde") Nummer = Kunde.Member("standardtelefon") SetMember is used for write access. |
MemberCount (As Long) |
Returns the quantity of members of a Vertec object. |
MemberWithSQL(membName As String, sqlWhere As String, sqlOrder As String) As IVtcObjectList/VtcObjectListProxy |
Allows for persistent Multilink Members to load only a selection of the linked objects using SQL Filter. The executing user must have administrator privileges or SQL Query privileges. Dim Projekt As Object Dim Rechlist As Object Set Projekt = Vertec.Argobject Set Rechlist = Projekt.MemberWithSQL("rechnungen", "datum between '01.01.2023' and '31.03.2023'", "nummer") |
RemoveTag(Tagname as String) |
Removes one day from the object. Set Projektbearbeiter = Vertec.User Projektbearbeiter.RemoveTag "mytag" Tags can be added with AddTag(Name). |
SetKeyValue(key As String, Value) |
Sets a key value on the object. Set Projektbearbeiter = Vertec.User Projektbearbeiter.SetKeyValue "Datum", Date Projektbearbeiter.SetKeyValue "Checked", True There is no separate method for querying key values, but is done via OCL : Dim Datum As Date Dim Checked As Boolean Datum = Projektbearbeiter.Eval("keydate('Datum')") Checked = Projektbearbeiter.Eval("keybool('Checked')") Removing a key value is done by setting the corresponding key with Projektbearbeiter.SetKeyValue "Datum", Nothing Projektbearbeiter.SetKeyValue "Checked", "" |
SetMember(membername, value) |
Writes the passed value to the member of the specified name. The value can be either an attribute or a link (object). Set Projektbearbeiter = Vertec.User Set Adresse = Vertec.ArgObject Adresse.SetMember "betreuer", Projektbearbeiter Adresse.SetMember "bemerkung", "Betreuer hinzugefügt" Member(Name) is used for read access. |
SetMemberOutOfDate
|
The method sets a particular member “out of date,” so that the next time the database is accessed again and so the current value is in it. Use case: for self-built number generators call “SetMemberOutOfDate” before accessing a member, then e.g. count one up, then immediately call “UpdataDatabase,” so the probability is small that the same number will be assigned twice. The method can also be used on derived attributes and thus a new calculation can be triggered without anything having changed (as is usually the case with derived attributes). |
SetMLValue(Index, Value As String, Language As String) |
Sets Texts as multi-language strings (mlstrings) in the different languages.
Taetigkeit.SetMLValue("text", "Vacanze", "IT") The MLStrings are queried via GetMLValue. |
Setadditional field(Name As String, Value As String) |
Sets the value of the with the corresponding name as a string. Cannot be used for object add-ons. For field types <> For additional selection fields, the string value is passed. Set Adresse = Vertec.ArgObject Adresse.SetZusatzfeld "Druckoption", "Alles" Adresse.SetZusatzfeld "Checked", "1" Adresse.SetZusatzfeld "Anmerkungen", "Kontrolliert" Custom fields are queried via custom field(name) or custom fieldAsVariant(name). |
Setadditional fieldAsVariant(Name As String, Value) |
Sets the value of the Custom Fields with the corresponding name as a variant. Can be used for all custom field types.For additional selection fields, the value can be passed as a string or as an integer. Set Adresse = Vertec.GetObjectById(3174) Adresse.SetZusatzfeldAsVariant "Druckoption", 1 Adresse.SetZusatzfeldAsVariant "Checked", True Adresse.SetZusatzfeldAsVariant "Anmerkungen", "Kontrolliert" Set Bericht = Vertec.GetObjectById(51371) Adresse.SetZusatzfeldAsVariant "Adressbericht", Bericht Custom fields are queried via custom field(name) or custom fieldAsVariant(name). |
Unlink(target: IVtcObject; role: string) |
Removes a shortcut to the passed object with the specified role. Set Person = Vertec.GetObjectById(3045) Set Firma = Vertec.GetObjectById(3174) Person.Unlink Firma, "VR-Mandate" Note for custom links: If delete sharing is configured, the link cannot be resolved using this method. The resolution of such a link is only possible by deleting one of the link partner objects. LinkTo can be used to create links. For detailed information, see Operators and Methods for Links. |
UnloadObject |
Removes the object from the Vertec object store. Use with caution, as subsequent access to the unloaded object may result in errors. |
Custom field(additional field name as string) |
Read access to the custom field. Returns the value as a string regardless of type (corresponds to the OCL query additional fieldasstring ). If a custom item has the value NULL, an empty string is returned. For additional selection fields, the string value is supplied. Dim Druckoption As String Dim Checked As String Dim Anmerkung As String Dim Bericht As String Druckoption = Adresse.Zusatzfeld("Druckoption") Checked = Adresse.Zusatzfeld("Checked") Anmerkung = Adresse.Zusatzfeld("Anmerkungen") Bericht = Adresse.Zusatzfeld("Adressbericht") Custom items are written with SetAdditionalfield or SetAdditionalfieldAsVariant. |
Additional fieldAsVariant
|
Read access to the custom field. Returns the value depending on the type. If a custom item has the value NULL, the default value for the field type is returned (numbers 0 or 0.00, String ““). For additional selection fields, the integer value is supplied. Dim Druckoption As Integer Dim Checked As Boolean Dim Anmerkung As String Dim Bericht As Object Druckoption = Adresse.ZusatzfeldAsVariant("Druckoption") Checked = Adresse.ZusatzfeldAsVariant("Checked") Anmerkung = Adresse.ZusatzfeldAsVariant("Anmerkungen") Set Bericht = Adresse.ZusatzfeldAsVariant("Adressbericht") Custom items are written with SetAdditionalfield or SetAdditionalfieldAsVariant. |
All list results (e.g. return values of Eval, Member, etc.) are represented by an IVtcObjectList/VtcObjectListProxy interface. This interface has the following properties and features:
Feature / Function | description |
---|---|
Add(obj As IVtcObject/VtcObjectProxy) |
Adds an object to the list: Set Projektbearbeiter = Vertec.User Set Bearbeiterlist = Vertec.CreateList("Projektbearbeiter") Bearbeiterlist.Add Projektbearbeiter If the list is a link member of a Vertec object, a new link is effectively created: Set Benutzergruppe = Vertec.ArgObject Set Bearbeiterlist = Benutzergruppe.Eval("benutzer") Bearbeiterlist.Add Projektbearbeiter |
AddList(list As IVtcObjectList/VtcObjectListProxy) |
Adds the submitted list to the up-date list. Set Benutzergruppe = Vertec.ArgObject Set Benutzerlist = Benutzergruppe.Eval("benutzer") Set Bearbeiterlist = Vertec.GetWithSQL("projektbearbeiter", "bold_id IN (Select Projektleiter FROM Projekt)", "name") Benutzerlist.AddList Bearbeiterlist |
Count As Long |
Quantity of objects in the list. |
Eval(expression As String) |
Evaluates the specified OCL expression in the list. Set Projektbearbeiter = Vertec.User Set Leistlist = Projektbearbeiter.Eval("offeneLeistungen") Vertec.SetObjVariable "aktBearb", Projektbearbeiter Set Projektliste = Leistlist.Eval("self->select(projekt.projektleiter=aktBearb)") |
EvalAsString(expression As String) As String |
Like Eval, the result is returned as a string. |
Includes(item As IVtcObject/VtcObjectProxy) As Boolean |
Specifies whether an object exists in the list. Set Projektbearbeiter = Vertec.User Set Benutzergruppe = Vertec.ArgObject Set Benutzerlist = Benutzergruppe.Eval("benutzer") If Benutzerlist.Includes(Projektbearbeiter) Then ... |
IndexOf(item As IVtcObject/VtcObjectProxy) As Long |
Specifies the position of the specified object in the list. 0-based. If not included: -1. Set Projektbearbeiter = Vertec.User Set Benutzergruppe = Vertec.ArgObject Set Benutzerlist = Benutzergruppe.Eval("benutzer") i = Benutzerlist.IndexOf(Projektbearbeiter) |
Objects(Index As Long) As Object |
Returns an object from the list with an index. 0-based. Set Projektliste = Projektbearbeiter.Eval("eigProjekte") For i = 0 To Projektliste.Count - 1 Set Projekt = Projektliste.Objects(i) Projekt.SetMember "code", UCase(Projekt.Member("code")) Next i |
Remove(obj As IVtcObject) |
Removes an object from the list. If the list is a link member of a Vertec object, a link is effectively deleted. It must be checked if the object to be removed is really in the list, otherwise the error will appear Set Projektbearbeiter = Vertec.User Set Benutzergruppe = Vertec.Argobject Set Benutzerlist = Benutzergruppe.Eval("benutzer") If Benutzerlist.Includes(Projektbearbeiter) Then Benutzerlist.Remove Projektbearbeiter End If |
RemoveByIndex(Index As Long) |
Removes an item from the list based on its index. 0-based. If the list is a link member of a Vertec object, a link is effectively deleted. Note that the indexes of the remaining objects in the list change. If items are removed because of the indexes, we recommend doing so in reverse order. Set Benutzergruppe = Vertec.ArgObject Set Benutzerlist = Benutzergruppe.Eval("benutzer") For i = Benutzerlist.Count - 1 To 0 Step -1 Benutzerlist.RemoveByIndex (i) Next i |
For certain objects such as projects, invoices etc. own interfaces are defined, which inherit from IVtcObject/VtcObjectProxy. In addition, these interfaces have their own features, which are only available on them, e.g. posting or cancelling invoices.
Interfaces | Methods |
---|---|
Activity / ActivityProxy | SetPath |
ITimDelivery / TimDeliveryProxy | MakeOffen, MakeBilled |
ITimEditor / TimEditorProxy | StartTimer, StopTimer |
ITimPerformance / TimPerformanceProxy | MakeOffen, MakeBilled, UpdateSatz |
ITimInvoice / TimInvoiceProxy | Post, CreateBeleg, ImportPayments, MakeOpen, MakeCreated, ManipulateToOriginalState, ManipulateToTotalAmount, SetTotal, Cancel |
ITimExpenses / TimExpensesProxy | MakeOffen, MakeBilled |
ITimCurrency / TimCurrencyProxy | GetCourseTo |
For viewing the object catalog, code completion and compile-time type checking, the Vertec Type Library can be integrated into the external application. Here in the example we use Microsoft Excel for viewing.
First, we reference the Vertec Type Library. This is done in the Visual Basic Editor via the menu Tools > References. The following window opens:
In the available references we activate the Vertec Typelibrary
.
Now we have access to the object catalog:
Using the View > Object Catalog menu or the function key F2
the object catalog opens.
In the Combobox <Alle Bibliotheken> we select Vertec
off. The following view appears:
If a class is marked on the left (in this example the IVtcObject), the corresponding methods (as symbol the green cubes) and properties (as symbol the hand) are displayed on the right.
It is important that the objects are not directly linked to types such as e.g. IVtcObject
, App
etc. The declaration of objects, object lists, session etc. always takes place on Object
. So not:
Dim Projektbearbeiter as IVtcObject
But:
Dim Projektbearbeiter as Object
The corresponding interfaces are available during operation as soon as the object is loaded.