Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<Work_Order__c> woList = [Select id,
- (Select Id,
- IsPending,
- ProcessInstanceId,
- TargetObjectId,
- StepStatus,
- OriginalActorId,
- ActorId,
- RemindersSent,
- Comments,
- IsDeleted,
- CreatedDate,
- CreatedById,
- SystemModstamp
- FROM ProcessSteps
- ORDER BY CreatedDate DESC)
- From Work_Order__c
- WHERE Id IN : Trigger.new];
- if(woList.size() > 0){
- for(Work_Order__c wo : woList){
- for(Work_Order__c wo1 : Trigger.new) {
- if(wo.id == wo1.id && wo1.copy_comment__c ) {
- if (wo.ProcessSteps.size() > 0) {
- wo1.Approver_Comment__c = wo.ProcessSteps[0].Comments;
- wo1.copy_comment__c = false;
- }
- }
- }
- }
- }
- }
- if(woList.size() > 0){
- if (wo.ProcessSteps.size() > 0) {
- wo.Approver_Comment__c = wo.ProcessSteps[0].Comments;
- wo.copy_comment__c = false;
- }}}}
Add Comment
Please, Sign In to add comment