• Pranav Nair
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
Hello,
I am using eventRelation objects to link contacts to an event, and the following is the code i've implemented.
for id in acceptedInviteeIds:
        eventRelation = h.generateObject('EventRelation')
        eventRelation.EventId = result.id
        eventRelation.RelationId = id
        eventRelation.isInvitee = True
        eventRelation.isParent = False
        result1 = h.create(eventRelation)

(I'm using salesforce-python-toolkit here) But this gives me the following result. 
(SaveResult){
   errors[] = 
      (Error){
         message = "duplicate value found: <unknown> duplicates value on record with id: <unknown>"
         statusCode = "DUPLICATE_VALUE"
      },
   id = None
   success = False
 }

Please suggest. Thanks!!  
Hello,
I am using eventRelation objects to link contacts to an event, and the following is the code i've implemented.
eventRelation = h.generateObject('EventRelation')
eventRelation.EventId = result.id
eventRelation.RelationId = id
eventRelation.isInvitee = True
eventRelation.isParent = False
result = h.create(eventRelation)

(I'm using salesforce-python-toolkit here) But this gives me the following result.
(SaveResult){
   errors[] = 
      (Error){
         message = "duplicate value found: <unknown> duplicates value on record with id: <unknown>"
         statusCode = "DUPLICATE_VALUE"
      },
   id = None
   success = False
 }

Please suggest. Thanks!!  
Hi, I'm new to this area and need some help. I have a Google Event with a list of invitees. I have a python code which syncs this event with Salesforce by creating a Event sObject. I queried for the emails in the invitees list of my Google event to check whether such a contact exists.

Now I want to add Invitees through my python code to the Event sObject created in sync with Google Event. I am using salesforce-python-toolkit for the same.(https://github.com/BayCitizen/salesforce-python-toolkit). This is a snippet of the code i have implemented so far. (here eventData is a dictionary containing the information about the event)
h=SforceEnterpriseClient('file://localhost/path-to/wsdl.jsp.xml')
h.login('username','pass','token')
event = h.generateObject('Event')
event.Subject = eventData['title']
event.Location = eventData['location']
event.Description = eventData['description']

acceptedIds = []
for email in eventData['invitees']:
    #query their contacts database using suitable query to check whether a contact who is invitee is available
    query_contact = h.query("SELECT Id,Name FROM Contact WHERE Email=" + "'" + email + "'")
    if query_contact.size != 0 :
        for record in query_contact.records:
            acceptedIds.append(record.Id)
event.AcceptedEventInviteeIds = acceptedIds
result = h.create(event)
h.logout()

But this is not updating the event on my salesforce developer account online, and I cant seem to find the problem. Please suggest changes to this code. 
Thanks!!
Hi, I'm new to this area and need some help. I have a Google Event with a list of invitees. I have a python code which syncs this event with Salesforce by creating a Event sObject. I queried for the emails in the invitees list of my Google event to check whether such a contact exists.

Now I want to add Invitees through my python code to the Event sObject created in sync with Google Event. I am using salesforce-python-toolkit for the same.(https://github.com/BayCitizen/salesforce-python-toolkit). This is a snippet of the code i have implemented so far. (here eventData is a dictionary containing the information about the event)
h=SforceEnterpriseClient('file://localhost/path-to/wsdl.jsp.xml')
h.login('username','pass','token')
event = h.generateObject('Event')
event.Subject = eventData['title']
event.Location = eventData['location']
event.Description = eventData['description']

acceptedIds = []
for email in eventData['invitees']:
    #query their contacts database using suitable query to check whether a contact who is invitee is available
    query_contact = h.query("SELECT Id,Name FROM Contact WHERE Email=" + "'" + email + "'")
    if query_contact.size != 0 :
        for record in query_contact.records:
            acceptedIds.append(record.Id)
event.AcceptedEventInviteeIds = acceptedIds
result = h.create(event)
h.logout()

But this is not updating the event on my salesforce developer account online, and I cant seem to find the problem. Please suggest changes to this code. 
Thanks!!