You need to sign in to do that
Don't have an account?
Event: bad field names on insert/update call: EndDateTime, StartDateTime
When I am passing the values for creating the record its give an error in these fields EndDateTime,StartDateTime of Event Table.
And the error is-
{errors:{fields:EndDateTime,StartDateTime, message:'Event: bad field names on insert/update call: EndDateTime, StartDateTime', statusCode:'INVALID_FIELD_FOR_INSERT_UPDATE', }, id:null, success:'false', }
I am inserting these values in Production system it gives above error.
But,When I am inserting the same values in our development system it didn't produces any error.
Code:-
I am using this java script-
var eEvent=new sforce.SObject("Event");
eEvent.OwnerId="{!SE_Request__c.OwnerId}";
eEvent.WhatId="{!SE_Request__c.Id}";
if("{!SE_Request__c.ContactId__c}" != "")
{
eEvent.WhoId ="{!SE_Request__c.ContactId__c}";
}
if("{!SE_Request__c.LeadId__c}" != "")
{
eEvent.WhoId ="{!SE_Request__c.LeadId__c}";
}
eEvent.Description="{!SE_Request__c.Description__c}";
eEvent.DurationInMinutes=60;
eEvent.ActivityDate=date("{!Today}");
eEvent.ActivityDateTime=date("{!SE_Request__c.Preferred_Start_Date_Time__c}");
eEvent.StartDateTime=date("{!SE_Request__c.Preferred_Start_Date_Time__c}");
eEvent.EndDateTime=date("{!SE_Request__c.Preferred_Start_Date_Time__c}");
eEvent.ReminderDateTime=dateRem(my_time);
var result = sforce.connection.create([eEvent]);
var eEventAtt=new sforce.SObject("EventAttendee");
eEventAtt.AttendeeId="{!SE_Request__c.OwnerId}";
var resultAtt = sforce.connection.create([eEventAtt]);
it gives an error in this line(Red Line).
Error is –
{errors:{fields:EndDateTime,StartDateTime, message:'Event: bad field names on insert/update call: EndDateTime, StartDateTime', statusCode:'INVALID_FIELD_FOR_INSERT_UPDATE', }, id:null, success:'false', }
Message Edited by RainMan on 09-29-2008 12:05 PM
I am using "version 13.0". in both the System . As for as i am concern this error is not generate due to the version difference.
both 'StartdateTime' and 'EnddateTime' has a same data type datetime. and in this js I am inserting datetime value in ActivityDatetime Field (having datatype DateTime) also and we didn't get error in this field..
the error we are getting the error "Event: bad field names on insert/update call: EndDateTime, StartDateTime".
May be error produces for the Field name in the Data base.
I am still searching the solution......
In this case I'd ask if the permissions and access for the fields in the event object are the same for both logins?
Best, Steve.
p.s. I might also look at the contents of the "Description" field. If you search the boards you'll find references to the problem that arises when you try to substitute a Textarea field using the "{!xxxx}" syntax, especially if there are line breaks in the textarea.
If that hasn't bit you yet, it might. The typical way to fix it is to create a hidden textarea element in your html and give it the value using the {! } syntax. Then access it via getElementById('id of the dummy element').value.
Here's a link: http://community.salesforce.com/sforce/board/message?board.id=ajax_toolkit&message.id=5340