• dssa
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Hello all. I'm very new to Salesforce environment. Any suggestions would be much appreciated.

 

My org has 2 users who handle cases. User A & User B

 

I'm trying to code a trigger to get a dynamic count of cases closed by each user.

 

So far, this is what I have:

 

trigger t on Case (after insert, after update)
for(case c: Trigger.New)
integer i = [Select count() from Case where id =: trigger.new and isClosed = true and CreatedbyId=UserA];
integer j = [Select count() from Case where id =: trigger.new and isClosed = true and CreatedbyId=UserB];
update c;

Thanks in advance.

Cheers

 


 

  • June 01, 2012
  • Like
  • 0

Hello all. I'm very new to Salesforce environment. Any suggestions would be much appreciated.

 

My org has 2 users who handle cases. User A & User B

 

I'm trying to code a trigger to get a dynamic count of cases closed by each user.

 

So far, this is what I have:

 

trigger t on Case (after insert, after update)
for(case c: Trigger.New)
integer i = [Select count() from Case where id =: trigger.new and isClosed = true and CreatedbyId=UserA];
integer j = [Select count() from Case where id =: trigger.new and isClosed = true and CreatedbyId=UserB];
update c;

Thanks in advance.

Cheers

 


 

  • June 01, 2012
  • Like
  • 0