GetRowset method: Message class

Syntax

GetRowset([version])

Description

The GetRowset method returns a standard PeopleCode level zero rowset object for the specified message version. It creates an empty rowset for the specified message version if it doesn’t already exist. If no message version is specified, the default message version is used.

When you use the GetRowset method, you are not creating a unique copy of the object. You are making only a copy of the reference. If you change the rowset, the original message is changed.

Parameters

Parameter Description

version

An optional parameter, specifying an existing message version as a string. If version isn’t specified, the default message version is used.

Returns

A Rowset object if successful.

Example

The following gets all the SET_CNTRL_REC rows related to the row on the page, then updates the field SETID with the value from the page. GetRowset is used to create a rowset based on the message structure, that is, an unpopulated rowset. Because the rowset is unpopulated, you can use the Fill method to populate with data from the page.

Local Message &MSG;
Local Rowset &MSG_ROWSET;

If FieldChanged(SETID) Then
  &MSG = CreateMessage(OPERATION.SET_CNTRL_REC);
  &MSG_ROWSET = &MSG.GetRowset();
  &MSG_ROWSET.Fill("where SETCNTRLVALUE =:1 and REC_GROUP_ID =:2", SETCNTRLVALUE,⇒
 REC_GROUP_ID);

  For &I = 1 To &MSG_ROWSET.ActiveRowCount
    &MSG_ROWSET.GetRow(&I).SET_CNTRL_REC.SETID.Value = SETID;
    &MSG_ROWSET.GetRow(&I).PSCAMA.AUDIT_ACTN.Value = "C";
  End-For;

  %IntBroker.Publish(&MSG);

End-If;