• Carbon
  • NEWBIE
  • 0 Points
  • Member since 2013

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

After a process step is approved, I'm sending an email to the approver. In that I need to display all approved process steps in that process instance with date/time value of when all process steps are approved. Can anyone help me into this.

Approval history related list

I can query the approval step approver and comments - 

SELECT Actor.userRole.Name, OriginalActor.Name, OriginalActor.Title, StepStatus, comments,
                 ProcessInstance.CompletedDate, ElapsedTimeInDays, ElapsedTimeInHours, ElapsedTimeInMinutes
                 FROM ProcessInstanceStep where ProcessInstance.TargetObjectId=:<targetObjId>
                 and stepStatus='Approved'

But could not get the approval date.

Thanks in advance!

Hi,

I am trying to automatically assign a new user to a Chatter Group called 'Everyone'.  The code below works as long as I do not select a role; however, when I select a role I get the following error.  Does anyone have a clue what this error means or if there is a code that can do what I am trying to do?

 

22:29:46.425
(425800000)|EXCEPTION_THROWN|[24]|System.DmlException: Insert failed.
First exception on row 0; first error: MIXED_DML_OPERATION, DML
operation on setup object is not permitted after you have updated a
non-setup object (or vice versa): CollaborationGroupMember, original
object: User: []
22:29:46.426
(426685000)|FATAL_ERROR|System.DmlException: Insert failed. First
exception on row 0; first error: MIXED_DML_OPERATION, DML operation on
setup object is not permitted after you have updated a non-setup object
(or vice versa): CollaborationGroupMember, original object: User: []

 

 

 

trigger User_trigger on User (after insert, before insert, after update, before update) {
    if ( Trigger.isInsert ) {    
        if ( Trigger.isAfter ) {
            List<CollaborationGroupMember> cgm = new List<CollaborationGroupMember>();              
            Id cgID = [ Select Id 
                      FROM CollaborationGroup 
                      WHERE Name = 'Everyone' LIMIT 1 ].ID;
System.debug('zzz: ' + cgID);    
            for ( user u: Trigger.new ) {
                cgm.add(new CollaborationGroupMember (CollaborationGroupId = cgID, MemberId = u.id));    
            }    
            insert cgm;          
        }
    }
}

 



Hello.

I just downloaded Force.com explorer, and hav a question.

 

When the login screen pops up, is it expecting the developer login I created at Force.com, or the name and password in the config file?

Neither works, so I may not even be asking the right question!

 

Thanks.

  • October 04, 2010
  • Like
  • 0