Last modified by jklein on 2025/06/16 08:23

From version 4.2
edited by jklein
on 2025/06/16 07:59
Change comment: There is no comment for this version
To version 4.1
edited by jklein
on 2025/06/16 07:57
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -37,12 +37,35 @@
37 37  
38 38  An diesem Output ist ersichtlich, dass das Cmdlet eine Liste von **TContact_V3** erwartet. Es müssen also Kontakte mithilfe von **New-TContact_V3** erstellt und befüllt werden.
39 39  
40 -=== Beispiel 2: Speichern von Kontakten ===
40 +=== Beispiel 2 ===
41 41  
42 -{{apimacro title="Speichern von Kontakten"}}
43 -Text
44 -{{/apimacro}}
42 +{{code language="PowerShell" layout="LINENUMBERS" title="**Beispiel: Speichern von Kontakten**"}}
45 45  
44 +# Erstellen einer Liste
45 +$contacts = @()
46 +
47 +# Erstellen eines Kontakts
48 +$testContact = New-TContact_V3
49 +$testContact.ID = [guid]::NewGuid().ToString()
50 +$testContact.Name = "Max"
51 +$testContact.FamilyName = "Musterman"
52 +$testContact.Email = "mmusterman@testmail.de"
53 +
54 +# Hinzufügen des Kontakts zur Liste
55 +$contacts += $testContact
56 +
57 +# Ausführen des Public Api commands
58 +$result = Acmp-SaveContacts_V3 -Contacts $contacts
59 +
60 +# Ausgabe des results
61 +$result
62 +
63 +
64 +FirstErrorMsg ResultCode ResultMessage
65 +------------- ---------- -------------
66 + 0 OK
67 +{{/code}}
68 +
46 46  Anhand der Antwort der Public API ist eine Fehlerbehandlung möglich.
47 47  
48 48  
© Aagon GmbH 2025
Besuchen Sie unsere Aagon-Community