SyncRequest method: Message class

Syntax

SyncRequest([NodeName])

Description

Use the SyncRequest method to send a synchronous message for the default message version.

Note:

This method has been desupported and remains for backward compatibility only. Use the IntBroker class SyncRequest method instead.

Use the IsActive property to determine if a message is active or not before using this method.

This method sends a single message synchronously, that is a reply message is returned as a result of this method.

If you want to publish a message asynchronously, use the Publish method.

If you want to publish more than one message at a time synchronously, use the IntBroker SyncRequest method.

Note:

This method supports nonrowset-based messages only if the SetXmlDoc method is used to populate the message prior to using the SyncRequest method.

The SyncRequest method can be called from any PeopleCode event, but is generally called from an Application Engine PeopleCode step or from a component.

When sending a synchronous request from a component, you should send messages only from the SavePostChange event, either from record field or component PeopleCode. This way, if there’s an error in your SyncRequest code, the data isn’t committed to the database. Also, since SavePostChange is the last Save event fired, you avoid locking the database while the other save processing is happening.

If the message is successfully sent, a response message is returned. In addition, the GUID property is updated with a unique identifier.

Parameters

Parameter Description

NodeName

Specify the name of the node that you want to send this message to.

Returns

A response message.

Example

Local Message &request, &response;
Local Rowset &sales_order;

&sales_order = GetLevel0();
&request = CreateMessage(OPERATION.QE_SALES_ORDER);
&request.CopyRowsetDelta(&sales_order);
&response = &request.SyncRequest();
If (&response.ResponseStatus = 0) Then
   /* do processing */
End-If;