Address Vertec via COM Proxy from outside
The Vertec Desktop App and Cloud App can be accessed via the Vertec COM Interface and thus remotely controlled by another software running under Windows (especially all locally installed Microsoft Office apps).
The Difference between desktop app and cloud app is that the Cloud App offers a local COM server, although there is no business logic at all. This is simulated with a COM proxy to the actual COM server running on the server in the Vertec session. The traffic runs over the normal data connection and is therefore not suitable for data migrations or larger amounts of data.
Depending on whether the Desktop App (local COM server) or the Cloud App (proxy for connection to the COM server) is accessed via COM, the interfaces have different names. Since the Desktop App will be discontinued in the future and can also be accessed via the COM proxy, the COM proxy interfaces are described here. See also: Switch COM to COM Proxy and COM Forwarding.
All examples are written in Visual Basic.
This is the default interface of the Vertec COM server. CreateObject("Vertec.App") returns a session reference as a result.
Dim Vertec As Object
Set Vertec = CreateObject("Vertec.App")Based on this, the Vertec objects can then be requested.
The ComCoClass has the following features:
| Feature / feature | description | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ArgObject |
Returns the current object (current 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 current 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 parameter /SUPER and the administrator is logged in. Otherwise the call will result in an error. |
||||||||||||||||||||||
CreateList(classname as string) |
Creates a new blank 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 used via COM if Vertec was started with the parameter /SUPER and the administrator is logged in. Otherwise the call will result in an error. |
||||||||||||||||||||||
Eval(expression as string) |
This feature evaluates any OCL expression. The result is returned as a variant and can be interpreted as a string, integer, float, boolean, or object, depending on the OCL expression. |
||||||||||||||||||||||
EvalToVariable(root as object, expression as string, varname as string) |
This allows values to be loaded into variables, which can then be used in OCL expressions. For example, you want to show services from a certain point in time. Instead of searching for services in the type “openperformance->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" can be specified. |
||||||||||||||||||||||
ExecuteFileReport
|
This feature can only be used in conjunction with 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 can be called up. |
||||||||||||||||||||||
GetObjectByID(ID: String or int) |
Returns the Vertec 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 a SQL query on a given Vertec class. This means that SQL selects all objects of a given class according to the specified criteria (SQL Select, Where Clause) and returns it as a list. The executing user must have administrator rights or the SQL Query right. 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, [Button 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 you to invoke a Vertec script. The executing user must have administrator rights or permission 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 it simply passes an object without evaluating an expression. |
||||||||||||||||||||||
user, project, phase, date, intervalTyp, value) |
Allows the setting of 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 call the details window of the Vertec object passed as argument. Note that this changes the ArgObject, i.e. the current object in Vertec. Vertec.ShowForm Projekt |
||||||||||||||||||||||
Translate(text As String) As String |
Translates a text into the current interface language.
Wert = Vertec.Translate("Projektbearbeiter")
|
||||||||||||||||||||||
UpdateDatabase |
Saves changes to the database and validates newly created objects. If they do not violate any rules, they will no longer be invalid. |
||||||||||||||||||||||
User |
Returns the current logged in users. |
This is the default interface for all Vertec objects.
For certain objects such as projects, invoices, etc. are additionally defined own interfaces, which inherit from VtcObjectProxy (the properties and features of VtcObjectProxy are also present there) and extend it by separate properties.
| Feature / feature | 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 string representation of the object 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 -> User |
Delete |
Deletes the object in Vertec. Return an error if the logged in user does not authorize 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 (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 directly returns the string representation of the result.
Dim Projektbearbeiter as Object
Dim Wert as String
Set Projektbearbeiter = Vertec.User
Wert = Projektbearbeiter.EvalAsString("stufe")
|
GetMLValue(Index, Language As String) As String |
If are present on the object as Multi-Language Strings (MLStrings), they can be queried in the other languages using this method.
Set Taetigkeit = Leistung.Eval("typ")
Wert = Taetigkeit.GetMLValue("text", "EN")
Query via Member ( The MLStrings are set via SetMLValue. |
HasTag(tag As String) As Boolean |
Queries 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 you can see in the example, the entire tree is considered, 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 (target) 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 unlinked again. For detailed information, see the article Operators and methods for links. |
Member(membername: string) |
Read access to the member with the specified name. This can be both an attribute and 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 VtcObjectListProxy |
Allows to load only a selection of linked objects with persistent Multilink members via SQL filter. The executing user must have administrator rights or the SQL Query right.
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 a tag 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 it is done via OCL:
Dim Datum As Date
Dim Checked As Boolean
Datum = Projektbearbeiter.Eval("keydate('Datum')")
Checked = Projektbearbeiter.Eval("keybool('Checked')")
The remove of 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 specific member “out of date,” so that the database is accessed again on the next access and so the current value is in it. Use case: with self-built number generators, call “SetMemberOutOfDate” before accessing a member, then e.g. count up one, then immediately call “UpdataDatabase,” then the probability is small that the same number is assigned twice. The method can also be used on derived attributes to trigger a new computation without any changes (as is 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 custom with its name as a string. Cannot be used for object extension fields. 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" The custom field items are queried via custom field item) or additional fieldAsVariant(name). |
SetAdditional fieldAsVariant(Name As String, Value) |
Sets the value of the custom item with the corresponding name as a variant. Can be used for all extension field types. Custom Field Items In the case of 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 The custom field items are queried via custom field item) or additional fieldAsVariant(name). |
Unlink(target: Object; Role: String) |
Removes a link 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 deletion forwarding is configured, the link cannot be resolved using this method. Such a link can only be resolved by deleting one of the link partner objects. Links can be created with LinkTo. For detailed information, see the article Operators and methods for links. |
UnloadObject |
Removes the object from Vertec object storage. Must be used with caution, as subsequent accesses to the unloaded object may result in errors. |
Zusatzfeld(custom field name as string) |
Read access to the custom field item. Return the value as a string regardless of type (equivalent to the OCL query extension additional field asstring). If an additional custom field 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 field items are written with setadditional field or setadditional fieldAsVariant. |
ZusatzfeldAsVariant
|
Read access to the custom field item. Return the value depending on the type. If an custom field 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 returned.
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 field items are written with setadditional field or setadditional fieldAsVariant. |
All list results (e.g. return values of Eval, Member etc.) are represented by a VtcObjectListProxy interface. This has the following properties:
| Feature / feature | description |
|---|---|
Add(obj As Object) |
Inserts an object into 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 Object) |
Adds the passed list to the current 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 |
Same as Eval, the result is returned as a string. |
Includes(item As Object) 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 Object) 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 VtcObjectProxy |
Returns an object from the list, specifying 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 Object) |
Removes an object from the list. If the list is a link member of a Vertec object, a link is effectively deleted. It is necessary to check 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 indices of the remaining objects in the list change. If items are removed due to the indices, 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. are defined their own interfaces, which inherit from VtcObjectProxy. In addition, these interfaces have their own features, which are only available for them, e.g. posting or cancelling invoices.
| Interface | Methods |
|---|---|
| ActivityProxy | SetPath |
| TimAuslageProxy | MakeOffen, MakeVerrechnet |
| TimBearbeiterProxy | StartTimer, StopTimer |
| TimLeistungProxy | MakeOffen, MakeVerrechnet, UpdateSatz |
| TimRechnungProxy | Buchen, CreateReceipt, ImportPayments, MakeOffen, MakeReceived, ManipulatetoOriginalState, ManipulatetototalAmount, SetTotal, Cancel |
| TimSpesenProxy | MakeOffen, MakeVerrechnet |
| TimCurrencyProxy | GetCourseTo |