Beschreibung:
Ein Foto wird aus der Datenbank ausgelesen und in eine Datei im Dateisystem geschrieben (Basis: Kontakte-Ansicht der Large-Solution).
VBScript:
Dim sFieldName : sFieldName = "Photo"
Dim sFileExtension : sFileExtension = ".jpg"
Dim sTempFileName : sTempFileName = cRM.CreateTempFile("Photo", sFileExtension, True)
Dim oRecord : Set oRecord = cRM.ActiveView.CurrentRecordSet.CurrentRecord
Call oRecord.GetContentsByNameToFile(sFieldName, sTempFileName)
Set oRecord = Nothing
C#-Script:
string fieldName = "Photo";
string fileExtension = ".jpg";
string tempFileName = cRM.CreateTempFile("Photo", fileExtension, true);
Record record = cRM.ActiveView.CurrentRecordSet.CurrentRecord;
record.GetContentsByNameToFile(fieldName, tempFileName);
record.Dispose();
TypeScript:
import { cRM } from "./sdk/combitCRM.SDK.WindowsClient.v13";
const fieldName : string = "Photo";
const fileExtension : string = ".jpg";
const tempFileName : string = cRM.CreateTempFile("Photo", fileExtension, true);
const currentRecord = cRM.ActiveView.CurrentRecordSet.CurrentRecord;
currentRecord.GetContentsByNameToFile(fieldName, tempFileName);
currentRecord.Dispose();