You need to sign in to do that
Don't have an account?
SFDC n12
Approval comments from approval process to a custom field
Hi,
I am having a approval process which is having 4 stages of approver
i want to capture the comments enterd by the 3 level of approver alone (not any other apperover) in a custom field
Help me how to achieve it
Thanks in Advance
I am having a approval process which is having 4 stages of approver
i want to capture the comments enterd by the 3 level of approver alone (not any other apperover) in a custom field
Help me how to achieve it
Thanks in Advance
more info about processinstance can be found here https://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_processinstance.htm
public class ApprProcess {
public static void ProcessInst(AccountExceptions__c [] o1) {
for(AccountExceptions__c o2:o1) {
List<AccountExceptions__c > op= [SELECT Id, ADR_Comments__c, (Select Id, IsPending, ProcessInstanceId, TargetObjectId, StepStatus, OriginalActorId, ActorId, RemindersSent, Comments, IsDeleted, CreatedDate, CreatedById, SystemModstamp From ProcessSteps)
FROM AccountExceptions__c];
for (AccountExceptions__c op1 : op) {
for (ProcessInstanceHistory pis : op1.ProcessSteps) {
o2.ADR_Comments__c = pis.Comments;
}
}
}
}
}
Here is my contrioller
public class ApprProcess {
public static void ProcessInst(AccountExceptions__c [] o1) {
for(AccountExceptions__c o2:o1) {
ProcessInstance [] op = [SELECT Id, (SELECT Id, StepStatus, Comments FROM Steps)
FROM ProcessInstance];
for (ProcessInstance op1 : op) {
for (ProcessInstanceStep pis : op1.Steps) {
if(op1.Status == 'Approved') {
o2.ADR_Comments__c = pis.Comments;
}
}
}
}
}
}
in this SOQL