CopyRowsetDelta method: Message class
Syntax
CopyRowsetDelta(source_rowset [, record_list]);
Where record_list is a list of record names in the form:
[RECORD.source_recname1, RECORD.target_recname1
[, RECORD.source_recname2, RECORD.target_recname2]]. . .
Description
The CopyRowsetDelta method copies rows of data that have changed from the source rowset to the like-named records and like-named fields in the message object executing the method.
Note:
CopyRowsetDelta copies all the like-named fields from the changed row into the message. It is not copying just the changed like-named fields.
When the record names in the message and component do not match exactly, use the optional record_list to specify the records to be copied from the component into the message. The specified target records must be records in your message, while the specified source records must be records in a rowset that exists in the data buffer and is populated.
This is an easy way to populate a message when the records in the message match the records in the component that the message is published from.
In addition, the CopyRowsetDelta method sets the AUDIT_ACTN field in the PSCAMA table for every row in the message. The notification process can then use PSCAMA.AUDIT_ACTN to determine how to process every row that was published.
The set values match those used in audit trail processing, that is:
-
A - Row inserted.
-
D - Row deleted.
-
C - Row changed (updated), but no key fields changed. The system copies the new value to the Message rowset.
-
K - Row changed (updated), and at least one key field changed. The system copies the old value to the Message rowset and the new value (see "N").
-
N - Row changed (updated), and at least one key field changed. The system copies the old value to the Message rowset and the new value (see "K").
-
"" − blank value means that nothing on that row has changed. This is the default value, and is the value used to tag the parent rows of children that have changed.
Note:
If a child row is inserted (or changed or deleted) CopyRowsetDelta also copies the parent row (and the parent row of that row, and so on, up to the top row) so the subscriber has a full picture of the transaction. A blank value is set in the AUDIT_ACTN field for these rows to let the subscriber know they don’t have to take action; the parent rows are there for reference only.
The Audit_Action values "A", "C", "D" are set when a record is added, changed, or deleted, respectively. In some cases such as effective-dated records, the user may change a key field value, such as Effective Date. In response to such an user action, two records are created, one with an Audit_Action value of "N", and the other with Audit_Action value "K". The "N" record has all the new values, while the "K" record retains the old values.
When you use the CopyRowsetDelta method to copy the contents from the source rowset to the message object, you are creating a unique copy of the object. If you change the original rowset, the message object is not be changed.
Note:
You can execute CopyRowsetDelta against a message only once. After a message is populated, any other CopyRowsetDeltas are ignored. If you have to populate different levels of a message rowset separately, you can use the CreateRowset method to create a rowset that has the same structure as your message, populate the created rowset, then use CopyRowsetDelta to populate your message. You can also use the Rowset CopyTo method to populate a message rowset, then populate the PSCAMA record by hand.
Parameters
| Parameter | Description |
|---|---|
|
source_rowset |
Specifies the name of the rowset to be copied into the message object. |
|
record_list |
Specifies source and target records to be copied into the message object. The target records must be records in your message, while the source records must be records in a rowset that exists in the data buffer and is populated. |
Returns
None.
Example
The following example copies all the changed rows of data from a component into a message object.
&Component_Rowset = GetLevel0();
&Msg.CopyRowsetDelta(&Component_Rowset);