ExchangePlansManager.DeleteChangeRecords

Syntax:

DeleteChangeRecords(<Nodes>, <Data>)

Parameters:

<Nodes> (required)

Type: ExchangePlanRef.; Array.
A single value of ExchangePlanRef. type or an array of such values indicating nodes for which change registration records are to be deleted.

<Data> (optional)

Type: Metadata, Undefined; ObjectDeletion; Number; <Data>.
This parameter value can be a metadata object, an object representing the data stored in the database, such as a document, catalog item, account, constant record manager, register record sets etc., a reference to a database object, as well as Undefined.
If a metadata object is specified, change registration records will be deleted for all data items belonging to the specified metadata object. Metadata object must be included in the exchange plans of all nodes specified in the first parameter.
If ObjectDeletion is specified, change registration record is deleted for a database object referred to by ObjectDeletion object.
If a reference or an object representing data stored in the database is specified, change registration records will be deleted only for the data specified. A metadata object corresponding to the data must be included in all exchange plans of all nodes specified in the first parameter.
If Undefined is specified, only a single node can be specified in the first parameter. In this case, the change registration records will be deleted for all objects with metadata included in the exchange plan to which the node specified in the first parameter belongs.
If a single node is specified in the first parameter, the message number can be used in the parameter. In this case, DeleteChangeRecords method deletes all change registration table records for the specified node which have a message number equal to or less than the value of the second parameter.
Default value: Undefined.

Description:

Deletes change registration records of a data item or a data item group for one or more exchange plan nodes.

Availability:

Server, thick client, external connection, Mobile application (server).

Example:

// Example 1
Cat = Catalogs.Currencies.FindByCode("810");
Node = ExchangePlans.EP1.FindByCode("Office");
ExchangePlans.DeleteChangeRecords(Node, Cat);

// Example 2
// Loading from a file
// Performing a try to open a file
XMLReader = New XMLReader;
Try
    XMLReader.OpenFile(FileName);
Except
    Return;
EndTry;
ReadingMessage = ExchangePlans.CreateMessageReader();
ReadingMessage.BeginRead(XMLReader);
If 
ReadingMessage.Sender <> Ref Then
    // Message is not for this node
    Raise "Wrong node";
EndIf
;
// Delete registration of changes for the node - message sender
ExchangePlans.DeleteChangeRecords(ReadingMessage.Sender, ReadingMessage.ReceivedNo);


    

1C:Enterprise Developer's Community