• Brett Thompson 20
  • 0 Points
  • Member since 2020

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 2

We've got a custom object named SE_Request__c that lets people add a request for support from our sales engineering team.  A request might be something like "I need a demo of xyz, via webex, to client Foo on 2012/03/02"


What I'm trying to do is write a trigger on the Object to write a new Event to a shared calendar after insert.  Our SF admin has set up a shared calendar named "Ops Calendar", but I can't figure out how to get a userId from that name for use in creating a new Event object.


Here's what I have, with a comment showing where I'm stuck...



trigger SE_Request_Calendar_Trigger on SE_Request__c (after insert) {
	 list<event> newEvents = new list<event>();
	 string salesOpsCalendar = 'Ops Calendar';

	 for (SE_Request__c seRequest : System.Trigger.new) {
	     try {
	         newEvents.add(new Event(
	             //  How do I convert 'Ops Calendar' to an id that owns our shared calendar?	             
	             OwnerId = ???, 

	             ActivityDateTime = seRequest.Date_of_Requested_Demo__c,

		         DurationInMinutes = 60,

		         // Local or on-site
		         Location = seRequest.Type_of_Demo__c,

		         Subject = 'Give a demo of ' + Products_for_Demo__c + ' for ' + seRequest.Requester_Name__c
	     catch(Exception e){
	 insert newEvents;



Hi All,


I'm receiving the following messsage when i'm clicking on some link(s) in my salesforce production environment.



This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Message>Access Denied</Message>


Why this message is displaying. How to over come this message.


Any help regarding this will be appreciated.


Thanks in Advance.


  • November 30, 2010
  • Like
  • 0