CurrentRecordSetCopy

Beschreibung:

Gibt die Kommentare mehrerer Aktivitäten-Datensätze aus. Basis ist hierbei der Aktivitäten-Container der Kontakte-Ansicht einer Large-Solution.

VBScript:

Dim oContainer : Set oContainer = cRM.ActiveView.CurrentInputForm(2).Containers.ItemByName("ID.Aktivitäten.ContactID#{ADD84570-956B-4079-8DE4-2B992DB3AEFE}")

Dim oCurrentRecordSet, oCurrentRecord

Set oCurrentRecordSet = oContainer.CurrentRecordSetCopy

 

If oCurrentRecordSet.MoveFirst Then

 

    Set oCurrentRecord = oCurrentRecordSet.CurrentRecord

    Dim sComment : sComment = ""

    Dim nCount : nCount = 0

 

    Do

        sComment = sComment & vbCrlf & vbCrlf & CStr(oCurrentRecord.GetContentsByName("Comment"))

        nCount = nCount + 1

    Loop Until Not oCurrentRecordSet.MoveNext

   

    Set oCurrentRecord = Nothing

Call cRM.DialogMessageBox("Kommentar: " & sComment & vbCrlf & nCount, "Container.CurrentRecordSetCopy", vbOkOnly)

   

End If

Set oCurrentRecordSet = Nothing
Set
oContainer = Nothing

C#-Script:

ListContainers containers = cRM.ActiveView.CurrentInputForm(2).Containers;

Container container = containers.ItemByName("ID.Aktivitäten.ContactID#{ADD84570-956B-4079-8DE4-2B992DB3AEFE}");

RecordSet containerRecordSet = container.CurrentRecordSetCopy();

Record containerRecord;

 

if (containerRecordSet.MoveFirst())

{

    containerRecord = containerRecordSet.CurrentRecord;

    string comment = string.Empty;

    int count = 0;

 

    do

    {

comment = comment + "\r\n" + "\r\n" + containerRecord.GetContentsByName("Comment");

        count++;

    } while (containerRecordSet.MoveNext() == false);

 

    containerRecord.Dispose();

 

cRM.DialogMessageBox("Kommentar: " + comment + "\r\n" + count, "Container.CurrentRecordSetCopy", 0);

}

 

containerRecordSet.Dispose();

TypeScript:

import {

    Container,

    cRM,

    RecordSet

} from "./sdk/combitCRM.SDK.WindowsClient.v13";

 

const container : Container =

    cRM.ActiveView

        .CurrentInputForm(2)

        .Containers

        .ItemByName(

            "ID.Aktivitäten.ContactID#{ADD84570-956B-4079-8DE4-2B992DB3AEFE}"

        );

 

const recordSet : RecordSet = container.CurrentRecordSetCopy();

 

if (recordSet.MoveFirst()) {

    let record = recordSet.CurrentRecord;

    let comment = "";

    let count = 0;

 

    do {

        comment +=

            `\r\n\r\n${String(record.GetContentsByName("Comment"))}`;

        count++;

    } while (recordSet.MoveNext());

 

    record.Dispose();

 

    cRM.DialogMessageBox(

        `Kommentar: ${comment}\r\n${count}`,

        "Container.CurrentRecordSetCopy",

        0

    );

}

 

recordSet.Dispose();

container.Dispose();