AnyOne tell me - How to add Reply to DiscussionBoard use SPServices

Mar 7, 2012 at 2:32 AM

I using the Library to do some things. Load ListItem, Get UserProfile .... . But now I want to add a reply to discussion board.

AnyOne tell me - How to do that.

Thank you.

Coordinator
Mar 12, 2012 at 2:54 AM

Discussions have two different Content Types: Discussion and Message. A Message is a reply to a Discussion, which is the start of a thread.

M.

Apr 3, 2012 at 4:47 PM
Edited Apr 3, 2012 at 4:48 PM

This works for me, although it fails when you try to add an item with a duplicate title.

$().SPServices({
      operation: "UpdateListItems",
      async: false,
      batchCmd: "New",
      listName: listName,
      valuepairs: [
                        ["FSObjType", "0"],
                        ["BaseName", discussionTitle + "/" + itemTitle"],
                        ["Title", itemTitle],
                    ],
      completefunc: function (xData, Status) {
          alert(xData.responseText);
      }
});
Jan 23, 2013 at 10:16 AM

Hi,

Above code very useful. But how can we reply to a reply? Do we have any sample for that? Your help will be highly appreciated.

Thanks,

Jigar

Sep 2, 2013 at 3:14 PM
Edited Sep 2, 2013 at 3:48 PM
[update]

It works! Thanks alot.
There was a " too much in your code and I did a cock-up when fixing that.
var discussionTitle = "18_.000";
var itemTitle = "reply"+ Number(new Date());

$().SPServices({
      operation: "UpdateListItems",
      async: false,
      batchCmd: "New",
      listName: listName,
      valuepairs: [
                        ["FSObjType", "0"],
                        ["BaseName", discussionTitle + "/" + itemTitle],
                        ["Title", itemTitle],
                        ["Body", "This is the reply body text"]
                    ],
      completefunc: function (xData, Status) {
          alert(xData.responseText);
      }
});