Plumtree EDK (Enterprise Web Development Kit) 5.4.0 |

# IDiscussionMessage.CreateDiscussionReplyMessage Method

Returns a discussion message that represents a reply.

IDiscussionMessage CreateDiscussionReplyMessage(
string subject,
string body
);

#### Parameters

subject
  Subject of the reply; cannot be `null`.
body
  Body of the reply; cannot be `null`.

#### Return Value

Discussion message that represents a reply. The returned discussion message has already been stored with the supplied subject and body.

#### Remarks

It cannot be called before the parent message has been stored. The created reply message will become persistent after this call, and no `Store` method is required afterwards. Notice this is different from `IDiscussion.CreateDiscussionMessage`, where `Store` needs to be call to persist the object. A reply can be created for both an approved and unapproved message using this method. Below sample code shows how to create a reply message.

    //CreateDiscussionReplyMessage() will create a persisted message, so
    //Store() does not need to be called to persist the reply message properties unless additional properties are set.
    IDiscussionMessage reply = parentMessage.CreateDiscussionReplyMessage("Sample Reply Subject" , " Sample Reply Body");

    //set additional properties
    reply.Description = "Optional description for reply message.";
    reply.Approved = true;

    //make sure Store() is called or the changes will not be persisted.
    reply.Store();

#### Exceptions

Exception Type | Condition
--- | ---
InvalidOperationException | if the object has not yet been stored or has already been removed.
CollaborationException | The method call resulted in an error.
SoapException | There is a communication problem during the execution of the remote method call.

#### See Also

IDiscussionMessage Interface | Plumtree.Remote.PRC.Collaboration.Discussion Namespace