• RickS
  • NEWBIE
  • 0 Points
  • Member since 2013

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

Is there a way to change the Finish button default on a VWF run from a custom button URL that's not referencing a VFP?  Basically I have a simple flow that starts with a button click from a detail page, which opens a new browser window and shows some data along with the standard VWF Finish button. 

 

What I'd like is for finish to close the window, not restart the workflow.

 

 

I have a trigger which is meant to update a field in a Case based on the Role or Type of the NEW owner when the case is transferred in ownership. However, it appears to be updating the field with the OLD owner's information. The end result is that the case will be transferred to the new user, but the role/type of the old user gets written to the updated field.

 

Clearly this means I'm doing something out of order, but I'm at the point now where I'm so frazzled I'm not going to figure it out until someone points out what I'm doing wrong. Any help is greatly appreciated.

 

Here's the code:



trigger getCaseOwner on Case (before update, before insert) {
    Case oldCase = trigger.old[0];
    Case newCase = trigger.new[0];
    String newOwnerId = newCase.OwnerId;
    String oldOwnerId = oldCase.OwnerId;
    
    String newOwnerRole = '';
    String newOwnerType;
    
    newOwnerType = [select owner.type from case where id = :newCase.Id].owner.type;
    
    if ( newOwnerType == 'User' ) {
        newOwnerRole = [select u.UserRole.Name from User u where u.Id = :newOwnerId limit 1].UserRole.Name;
    } else if ( newOwnerType == 'Queue' ) {
        newOwnerRole = newCase.owner.name + ' Queue';
    }
    
    newCase.Case_Owner_Role__c = newOwnerType;
}