+ Start a Discussion
Ankit Singh 6Ankit Singh 6 

Set Reminder Set(IsReminderSet) using SOAP api for a task

Hi All

We are creating a follow up task from our webapp using SOAP api call in C#. Now we want to set Reminder Set(IsReminderSet) field value while creating the task
We are using below code. We are able to create follow up task with all other fields but unable to set Reminder Set field which is of type boolean.

var doc = new XmlDocument();
var fields = new List<XmlElement>();
var task = new sObject { type = "Task" };
bool reminder = true;
XmlElement taskReminder = doc.CreateElement("IsReminderSet");
 taskReminder.InnerText = reminder.ToString();
fields.Add(taskReminder);
task.Any = fields.ToArray();
var result = _sf.create(new[] { task });
success = result[0].success;

Please let me know what I am doing wrong.

Regards
Ankit
Best Answer chosen by Ankit Singh 6
Daniel BallingerDaniel Ballinger

In addition to setting the Boolean IsReminderSet field to true you should also set the Task ReminderDateTime field to a UTC DateTime.

From the docs description:

Represents the time when the reminder is scheduled to fire, if IsReminderSet is set to true. IfIsReminderSet is set to false, then the user may have deselected the reminder checkbox in the Salesforce user interface, or the reminder has already fired at the time indicated by the value.

All Answers

Daniel BallingerDaniel Ballinger

In addition to setting the Boolean IsReminderSet field to true you should also set the Task ReminderDateTime field to a UTC DateTime.

From the docs description:

Represents the time when the reminder is scheduled to fire, if IsReminderSet is set to true. IfIsReminderSet is set to false, then the user may have deselected the reminder checkbox in the Salesforce user interface, or the reminder has already fired at the time indicated by the value.
This was selected as the best answer
Ankit Singh 6Ankit Singh 6
Thanks..It worked.
prabhat jhaprabhat jha
Thanks Daniel!..