• Devian Studio
  • NEWBIE
  • 0 Points
  • Member since 2019

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

I am working on trying to group my Event data with maps. What I am trying to accomplish is to group my Events in weeks > bookers > roll up count for booked appt for each week. My logic so far is:

map<string,list<Event>> Date2Event = new map<string,list<Event>>();
for(Event e: eventLst){
    if(!Date2Event.containsKey(dateMapKey(e.CreatedDate))){
         Date2Event.put(dateMapKey(e.CreatedDate), new list<Event>());
     }
     Date2Event.get(dateMapKey(e.CreatedDate)).add(e);
}

public string dateMapKey(datetime dt){
    	datetime myDt = dt;
    	date myDate = myDt.date();
    	date StartOfWeekDate = myDate.toStartOfWeek();
    	string mapKey = StartOfWeekDate.format() + '-' + StartOfWeekDate.addDays(6).format();
    	return mapKey;
}

So I have a function that is basically setting the map's key with a string of start date to end date. So far what I have accomplished is to group the events by week. Now I need to nest the grouping more and group by week and by bookers, then roll up count for each booked appt for that week. Any ideas would be greatly appreciated. Thanks.
Our company is looking for help with various process integration issues with DBSync and Quickbooks Accountant Edition 2007.  These are the issues:

1) Sales coming from website now come as web-to-lead, but need to come in as a "closed won" opportunity.
2) We need a way to automate recurring monthly sales.
3) When Quickbooks integration from DBSync comes in to show invoice paid we need to have it change the stage to "closed won."

We do all these things manually now.  Is there a simple way to do these things, or is a developer needed? 
Does anyone out there have experience doing these things?  If so, and you're interested in a project let us know - we'd love to talk to you!

Reply in the thread or contact Evan at Rugly (dot) com