<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<!--Created: 30.06.2015 15:50:24-->
<!--ACTOptimumVersion: 6.0.5581.26549-->
<AutoDataItems ACTOptimumVersion="6.0.5581.26549" Created="30.06.2015 15:50:24">
    <AutoDataControl Created="30.06.2015 15:50:24" ClassName="Melville_Schellmann.ACTOptimum3.Control.AutoData3.AutoData3" PrefClassVersion="1.0" ACTOptimumVersion="6.0.5581.26549">
        <Source>' #ScriptName: SaveContact
    ' #Description: DEUTSCH:
    '               Speichert den aktuellen Kontakt in der Zwischenablage und ermöglicht das Aufrufen des zwischengespeicherten Kontaktes über das AutoData-Script "LookupContact" in der gleichen Datenbank.
    '               
    '               ENGLISH:
    '               Saves the current contact to the clipboard and allows you to access the cached contact via the AutoData script "LookupContact" on the same database .
    ' #Author: Robert Schellmann
    ' #Copyright: Melville-Schellmann
    Dim PrefPath As String = "Melville-Schellmann/ACTOptimum4/SavedContactID" ' Name des Einstellungswertes
    Dim Title As String = "AutoData"
    Dim ContactID As System.Guid
    Dim ContactFullname As String
    Dim ConfigValue As Act.Shared.Config.Value
    Dim oContact As Act.Framework.Contacts.Contact = Nothing
    Dim CurrentUserID As System.Guid

    If ActApp.ActFramework.CurrentUser Is Nothing Then Exit Function

    CurrentUserID = ActApp.ActFramework.CurrentUser.ID


    ContactID = ActApp.ApplicationState.CurrentContact.ID

    ContactFullname = ActApp.ApplicationState.CurrentContact.FullName

    Try
      ConfigValue = ActApp.ActFramework.Preferences.UserPreferencesDB.GetUserPreference(PrefPath, CurrentUserID)
      If Not ConfigValue Is Nothing Then
        ActApp.ActFramework.Preferences.UserPreferences.AdminUpdateDBPreference(PrefPath, ContactID.ToString)
      Else
        ActApp.ActFramework.Preferences.UserPreferences.SetObjectValue(PrefPath, ContactID.ToString, CurrentUserID)
      End If
      MsgBox(String.Format("Kontakt: '{0}' wurde gespeichert.", ContactFullname), MsgBoxStyle.Exclamation, Title)

    Catch ex As Exception
      MsgBox(String.Format("Es ist ein Fehler beim Laden des Einstellungswertes '{0}' aufgetreten.", PrefPath) &amp; vbCrLf &amp; _
        ex.Message, MsgBoxStyle.Exclamation, Title)
    End Try</Source>
        <SourceComment>Begriff: {0}</SourceComment>
        <TargetFields></TargetFields>
        <MsgText>{0}</MsgText>
        <Picklist></Picklist>
        <Multiple>False</Multiple>
        <Expandable>True</Expandable>
        <OverwriteAlways>True</OverwriteAlways>
        <CopyToClipboard>False</CopyToClipboard>
        <ShowMsgBox>False</ShowMsgBox>
        <PositionMode>1</PositionMode>
        <FlatStyle>Standard</FlatStyle>
        <AutoDataText>Kontakt speichern</AutoDataText>
        <TextAlign>MiddleCenter</TextAlign>
        <AutoDataFormSize>160; 270</AutoDataFormSize>
        <TooltipText></TooltipText>
        <RefreshLoadedViews>False</RefreshLoadedViews>
    </AutoDataControl>
</AutoDataItems>