CopyRowset method: Message class
Syntax
CopyRowset(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 CopyRowset method copies data from the source rowset to the like-named fields in the message object executing the method. This is an easy way to populate a message with data from a component.
Note:
If a Related Language record is defined on a record that is effective dated, then the result of the CopyRowset method will not populate the Effective Date or Effective Sequence fields due to possible ambiguity when processed on the receiving system. If these fields are desired to include this information, then the Message Rowset can be updated accordingly after the CopyRowset call is invoked.
Note:
CopyRowset copies the data, including rows that haven’t been modified. If you want to copy only data that has changed in some way, use the CopyRowsetDelta method.
See CopyRowsetDelta method: Message class.
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.
When you use the CopyRowset 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 changed.
Note:
You can execute CopyRowset against a message only once. After a message is populated, any other CopyRowsets 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 CopyRowset 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 specific source and target records to be copied into the message object. |
Returns
None.
Example
The following example copies an entire component into a message object.
&Msg = %IntBroker.GetMessage();
&Rowset = &Msg.GetRowset()
&Component_Rowset = GetLevel0();
&Msg.CopyRowset(&Component_Rowset);
The following example copies a header/line page rowset into a header/line message object, using the record_list because the record names don't match:
&Msg = %IntBroker.GetMessage();
&Rowset= &Msg.GetRowset();
&Component_Rowset = GetLevel0();
&Msg.CopyRowset(&Component_Rowset, RECORD.PO_HDR_VW, RECORD.PO_HDR, ⇒
RECORD.PO_LINE_VW, RECORD.PO_LINE);