• Jay-Dawg
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
I have an s-control which invokes the API using Javascript and the AJAX Toolkit v11. My code is able to create Events, and I'm stuck now trying to create such Events to include multiple attendees.
 
The following code snippet does NOT work:
 
var TestAttendee = new sforce.SObject("EventAttendee")
TestAttendee.AttendeeId = "00570000000mZcp" //this is a valid User ID
TestAttendee.EventId = "00U70000006J7oq" //this is a valid existing Event ID
var result = sforce.connection.create([TestAttendee])
This returns the error "CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY". What am I missing?
 
Is EventAttendee createable? The API documentation does not list "create" as one of the available methods for this object type, however some of the EventAttendee fields say that they do support "create".
 
What about the Event.IsGroupEvent field? Do I need to set that to TRUE first, or does that happen automatically when attendees are added to that event? It doesn't seem like that field is updateable anyway, so I couldn't set it to TRUE if I wanted to.
 
Do the attendees need to be added during the initial creation of the event? How is that accomplished? I would assume you need the event first, in order to pass the EventID to the EventAttendee object, but perhaps I'm wrong?
 
Please help.
 
P.S. Salesforce Premier Support says that it IS possible to add EventAttendees via the API, but they won't tell me how and instead told me to buy Professional Services...
Hello -
 
I have an S-Control that, for all intents and purposes, opens the existing object (an Opportunity in this case) in Edit mode and then saves it immediately with no changes.  We want to trigger a workflow rule that copies information from roll-up summary fields to the Amount field, but this is only triggered with an edit on the Opp itself, not from the child edit(s).
 
So from a link (and eventually a button), we call the S-Control, which calls Edit/Save on the Opportunity, then we reload the parent and close the child.
 
I'm using opener.location.reload().
 
The trouble is, the Opportunity page frequently refreshes too quickly, in that the database change (apparently) hasn't gone through yet.  A subsequent refresh will display the changes, but what good is that?!
 
Here's the code:
Code:
oppHasBeenSaved = false;

function init() { 
// Open Opportunity Edit page & then save the Opportunity 
    try {
         if (oppHasBeenSaved == false) {
              var url = '{!URLFOR($Action.Opportunity.Edit, Opportunity.Id)}'; 
              window.parent.location = url + "&save=1";
              oppHasBeenSaved = true;
              updateComplete();
              close();
         }
         else {
              notify();
              close();
         }
    } catch(error) {
      alert(error);
    }
} // end function init()

function updateComplete() {
    //alert("inside updateComplete ...");
    opener.location.reload();
    opener.focus();
    close();
}

Is there a way to use window.setTimeout() or some other function to allow that background activity to be completed?  (I suggested an override to the Opportunity Product's Save button, but I was overruled, hence we're doing this from Opportunity.  There's no SOQL, so there's no waiting for the return to come back.)
 
Let me know what you know.
 
Thanks!

Does anyone have an S-Control  or Formula that will take a start date and add a duration in months to calculate an end date?

 

I've tried handling this in SF itself through a workflow rule trigger by breaking out the dates into MM DD Year fields and manipulating that way.  The problem is of course Validating the end date is a true since the current work around causes a problem.  ie: Jan 31 2007 + 1 Month = Feb 31, 2007 ... not a valid date.

 

Since we have Admin Support SF personnel tried to write a formula for the calculation and after a few weeks gave up and told me the only way to handle this is with a Custom S-Control.

 

Any suggestions / help would be appreciated.

 

Thanks

AGM

 
 
  • December 17, 2007
  • Like
  • 0