You need to sign in to do that
Don't have an account?
GraceW
How to avoid creating the same instance of events ?
Hi,
If I execute the following code multiple times, saleforce database is going to store the same event multiple times with the same ActivityDateTime. How can I avoid this? Is there any event field I need to set in order to achieve the goal?
Thx!
MessageElement[] event = new MessageElement[6];
event [0] = new MessageElement(new QName("WhoId"), leadid);
event [1] = new MessageElement(new QName("OwnerId"), spid);
event [2] = new MessageElement(new QName("Location"), "IBN");
event [3] = new MessageElement(new QName("Description"), "Demo of product");
event [4] = new MessageElement(new QName("ActivityDateTime"), "2006-12-26T12:37:00Z");
event [5] = new MessageElement(new QName("DurationInMinutes"), "60");
out.println("<br>New appointment created with the id : " + sfservice.setAppointment(event));
If I execute the following code multiple times, saleforce database is going to store the same event multiple times with the same ActivityDateTime. How can I avoid this? Is there any event field I need to set in order to achieve the goal?
Thx!
MessageElement[] event = new MessageElement[6];
event [0] = new MessageElement(new QName("WhoId"), leadid);
event [1] = new MessageElement(new QName("OwnerId"), spid);
event [2] = new MessageElement(new QName("Location"), "IBN");
event [3] = new MessageElement(new QName("Description"), "Demo of product");
event [4] = new MessageElement(new QName("ActivityDateTime"), "2006-12-26T12:37:00Z");
event [5] = new MessageElement(new QName("DurationInMinutes"), "60");
out.println("<br>New appointment created with the id : " + sfservice.setAppointment(event));
The only way I know is to perform a query with the same field entries in the Where clause. If you find a match, do not create a new event. If no match, create the event.
This is bit tedious, but it will prevent multiple events.
You also may want to update the event with new information on a partial match.