• Dortegalizardo
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies

Basically I just need to replicate the default form to create a new event by displaying it on a fancybox. I've successfully create a fullCalendar that displays all the events that are related to all the users inside our org. The main objective is to see all the events in one place rather than using the standard calendar that salesforce have. Now Im trying to add a new event from the calendar and Ive created a form, but I can't replicate the invitees section. So that the event will be related to all the users in org. I have been thinking on doing a trigger or if anyone has a better idea you can help me out.

 

Here are some pictures of it:

This is the calendar:

http://i1300.photobucket.com/albums/ag85/Douglas_Ortega/5f389585-e8b5-42f5-82c8-f9c29219d333_zpsa41203c5.jpg?t=1360959016

This is the fancybox to create a new event:

http://i1300.photobucket.com/albums/ag85/Douglas_Ortega/Newevent_zpsa4048477.png

This is the standard form the salesforce has for creating new event, I need the lower part of it. The one to add invitees:

http://i1300.photobucket.com/albums/ag85/Douglas_Ortega/fancycalendar_zpsff4b3999.png

Hi,

 

Well Im trying to get all the invitees from all the events. Ive tried the following:

 

public List<List<ActivityHistory>> lista {get;set;}
public List<List<ActivityHistory>> getOpen()
{

lista = new List<List<ActivityHistory>>();
SObject[] accounts = [SELECT Name,
(Select Subject, WhoId,WhatId, ActivityDate, Status, Priority, OwnerId FROM ActivityHistories) From Account];
for(SObject o : accounts){
if(o.getSObjects('ActivityHistories') != null){
List<ActivityHistory> element = (List<ActivityHistory>) o.getSObjects('ActivityHistories');
if(element != null){
lista.add(element);
}
}

}

return lista;
}

I get all the events by account and to test it Ive added 3 invitees for one of the test events. And when I run the query I only get the first invitee and no the other two. How can I get all the invitees in all the events?

 

Thanks in advance

This si my current Controller:

 

public class CalendarEventController{

public List <Account> getMyAccounts()
{
return [SELECT Id, Name, Region__c FROM Account ORDER BY LastModifiedDate DESC LIMIT 10];
}

public List<ActivityHistory> Actividades {get; set;}
public List<List<ActivityHistory>> lista {get;set;}
public List<List<ActivityHistory>> getOpen()
{

lista = new List<List<ActivityHistory>>();
SObject[] accounts = [SELECT Name,
(Select Subject, WhoId,WhatId, ActivityDate, Status, Priority, OwnerId FROM ActivityHistories) From Account];
/*for(Integer i = 0; i< accounts.size(); i++ )
{
if(accounts[i] != null)
{
Actividades.add(((List<ActivityHistory>)accounts.get(0).getSObjects('ActivityHistories')));
}
}*/
Actividades = (List<ActivityHistory>)accounts.get(1).getSObjects('ActivityHistories');


for(SObject o : accounts){
if(o.getSObjects('ActivityHistories') != null){
List<ActivityHistory> element = (List<ActivityHistory>) o.getSObjects('ActivityHistories');
if(element != null){
lista.add(element);
}
}

}

return lista;
}

}

 

As you may see im trying to get all the events from every account we have.

 

This is the apex code that im trying to use in order to display it on my visualforce page:

 

<apex:pageBlock>
<apex:pageBlockTable value="{!Open}" var="lista">
<apex:column value="{!lista.Subject}" headerValue="Subject"/>
</apex:pageBlockTable>
</apex:pageBlock>

 

I keep getting the same error: Error: Unknown property 'VisualforceArrayList.Subject'

Hi,

 

Well Im trying to get all the invitees from all the events. Ive tried the following:

 

public List<List<ActivityHistory>> lista {get;set;}
public List<List<ActivityHistory>> getOpen()
{

lista = new List<List<ActivityHistory>>();
SObject[] accounts = [SELECT Name,
(Select Subject, WhoId,WhatId, ActivityDate, Status, Priority, OwnerId FROM ActivityHistories) From Account];
for(SObject o : accounts){
if(o.getSObjects('ActivityHistories') != null){
List<ActivityHistory> element = (List<ActivityHistory>) o.getSObjects('ActivityHistories');
if(element != null){
lista.add(element);
}
}

}

return lista;
}

I get all the events by account and to test it Ive added 3 invitees for one of the test events. And when I run the query I only get the first invitee and no the other two. How can I get all the invitees in all the events?

 

Thanks in advance

This si my current Controller:

 

public class CalendarEventController{

public List <Account> getMyAccounts()
{
return [SELECT Id, Name, Region__c FROM Account ORDER BY LastModifiedDate DESC LIMIT 10];
}

public List<ActivityHistory> Actividades {get; set;}
public List<List<ActivityHistory>> lista {get;set;}
public List<List<ActivityHistory>> getOpen()
{

lista = new List<List<ActivityHistory>>();
SObject[] accounts = [SELECT Name,
(Select Subject, WhoId,WhatId, ActivityDate, Status, Priority, OwnerId FROM ActivityHistories) From Account];
/*for(Integer i = 0; i< accounts.size(); i++ )
{
if(accounts[i] != null)
{
Actividades.add(((List<ActivityHistory>)accounts.get(0).getSObjects('ActivityHistories')));
}
}*/
Actividades = (List<ActivityHistory>)accounts.get(1).getSObjects('ActivityHistories');


for(SObject o : accounts){
if(o.getSObjects('ActivityHistories') != null){
List<ActivityHistory> element = (List<ActivityHistory>) o.getSObjects('ActivityHistories');
if(element != null){
lista.add(element);
}
}

}

return lista;
}

}

 

As you may see im trying to get all the events from every account we have.

 

This is the apex code that im trying to use in order to display it on my visualforce page:

 

<apex:pageBlock>
<apex:pageBlockTable value="{!Open}" var="lista">
<apex:column value="{!lista.Subject}" headerValue="Subject"/>
</apex:pageBlockTable>
</apex:pageBlock>

 

I keep getting the same error: Error: Unknown property 'VisualforceArrayList.Subject'