We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [approval-process]

An approval process is configured on an object to specify all of the steps, users, actions, and relationships among them involved in approving or rejecting a record of that object. Approval processes can become very complex and tools such as the Process Visualizer can be used to aide in understanding them.

Filter by
Sorted by
Tagged with
22
votes
1answer
6k views

Apex approval process that requires unanimous approval from multiple approvers

Once every few months this requirement appears as part of a project. Here is some sample code: trigger AfterUpdate on Contact (After update) { for(Contact newContact: Trigger.new){ ...
21
votes
5answers
17k views

How to check if a record is locked or not in Apex during an approval process

I have an approval process on a Custom object and also two custom buttons on the same record. Once the record goes into the approval process, it gets locked. During that period, I want to disable/...
18
votes
2answers
4k views

Are triggers able to modify records locked by an approval process?

A lookup field in a custom object needs to be updated after the record is submitted for approval and locked. Is the trigger able to achieve this, even if the record is locked?
12
votes
1answer
3k views

Approval Process Not Respecting Else Approve Step

Question Is there any known issue with the approval process steps that have criteria that enter if it evaluates to true, else approve, auto-rejecting records that don't meet the criteria? If so, are ...
11
votes
4answers
14k views

Check if a record is in approval process

I´m getting this Exception: System.DmlException: Update failed. first error: ENTITY_IS_LOCKED, the entity is locked for editing: The problem is that i´m updating a case that is locked by an approval ...
10
votes
2answers
4k views

How to check if a record is locked through an approval process?

How do I check if a record of a custom object is locked through an approval process ? I know i can use the ProcessInstance to access my approval processes, but I can't check if it is locked or ...
10
votes
1answer
3k views

Query user's Items to Approve?

I need to create a new section on a custom landing page that gives the User a list of objects that they can approve, as they are a member of a queue being submitted to. The closest I can get is this :...
9
votes
3answers
7k views

Why Can't I Assign an Approval Step to a Queue for a Custom Object Approval Process?

I know that when running an approval process on Case, you have the option to assign an approval step to a Queue, however, I am now creating an approval process for a custom object, and I don't see the ...
9
votes
1answer
2k views

Submit records for approval in bulk without hitting DML Statement limit

I've got code to create and submit for approval a custom object. I'm running into the DML statement limit. As far as I can see each record I submit for approval takes up a DML statement, but there's ...
8
votes
1answer
9k views

How to deploy approval process using ANT/Eclipse in salesforce

I am trying to deploy approval process to cutomer Production orgs. It is difficult to do the manual creation of approval in each customer org. Anybody know this can be done by ANT/Eclipse ? Thanks in ...
8
votes
1answer
7k views

ProcessInstanceWorkitems not created when running an Approval Process unit test

We have code that will submit an Opportunity for approval when saved at a certain stage. When I do this manually in the UI I see the Opportunity is submitted for approval. I can query the ...
8
votes
2answers
2k views

Query Current Step Number for Approval process

Is it possible to retrieve the current Step Number for an approval process via a query? If so how? I don't see this as available field in the ProcessInstanceNode object. Thanks!! Looking for Step ...
7
votes
3answers
12k views

Unlock a record which is locked by approval process

I don't see a way to unlock a record that is locked by approval process.IsLocked flag is not accessible through api.Is there any way to do this.
7
votes
3answers
3k views

Prevent child records to be created when parent records is submitted for approval

I have a requirement that user can't add child records once the parent records is submitted for approval. In the approval process, parent record gets locked but I also want to prevent child records to ...
7
votes
2answers
5k views

Salesforce1 Publisher Action Submit Button overwrite

I created a object-specific publisher action, my objective is to submit the custom object on the redirected visualforce page. It works fine to pass the object parameters to the visualforce page, but ...
7
votes
2answers
4k views

Recall approval process by apex

I am attempting to recall an approval process with the following Apex code: Approval.ProcessWorkitemRequest pwr = new Approval.ProcessWorkitemRequest(); pwr.setAction('Removed'); pwr.setWorkItemId(...
7
votes
1answer
3k views

How do I recall an sObject from an approval process using apex?

While the apex developer documentation provides sample code on submitting an sObject to an approval provess with apex there is no documentation on how to recall an item from the approval process. Is ...
7
votes
1answer
110 views

Apex Approval.lock, programmatic locking and record editability

Background: In Winter '16, Salesforce introduced the Approval class for setting approval locks and unlocks through Apex (release notes). Since then, my company has been leveraging this functionality ...
6
votes
1answer
8k views

Approval lock/unlock with APEX

I am in Winter '16 and trying to unlock and lock a record in APEX and I am getting the following exception FATAL_ERROR System.UnexpectedException: Apex approval lock/unlock api preference not ...
6
votes
1answer
14k views

Difference between static and dynamic approval processes

Can anyone answer to the following questions: What is static approval process What are the limitations of static approval process Purpose of Dynamic approval process Differences between static and ...
6
votes
1answer
1k views

Salesforce1 Submit for approval

Does the submit for approval process works in Salesforce1? Is there currently a way to submit custom objects for approval in the Salesforce1 mobile app? Yes, thanks! I also wrote a trigger to toggle ...
6
votes
1answer
3k views

Can we change from email address of the approval process approver notification?

currently the approval notification which is going to current approver has from email address has current users email address. If approval has multiple steps, each step notification will have ...
6
votes
1answer
1k views

Can I update a locked Record using Partner API?

I have the following implementation: 1) Users create a process in SF, when the process is ready for the financial department they submit for approve. The record is locked. 2) When the approval is ...
6
votes
2answers
4k views

Is it possible to prevent a user from 'Approving' a step in an approval process if a certain field is blank?

Basically, I want to have validation rules run when a step in an approval process is approved. I would like the rule to take into account which step triggered the rule, so that each step can have ...
6
votes
1answer
1k views

Get all Approval Process names of a specific object XYZ__c in apex

I have created 4 approval process for an object XYZ__c. In a VF page I want a picklist of all the Approval Process Name of that Object. After selecting one of it I have workflow rules depending on the ...
6
votes
1answer
315 views

Limitation in changing from email address from out-going emails

I noticed that for some out-going email we are not able to change from email address like the following: Approver notification email from approval process. Assignment notification email from ...
6
votes
1answer
291 views

How to block rejection through email in approval process?

I have a scenario that approvers can approve the records through email, but they should not 'Reject' through email. Is it possible to achieve this through standard salesforce functionality? or any ...
5
votes
3answers
2k views

Who else can reply to an approval request beside the designated approver?

For the standard Salesforce approval processes, who else can approve a request besides the designated approver?
5
votes
2answers
742 views

Formula Fields Lock when Records are Locked?

Looking around the web I could not find any information on if a Formula field locks (data become static) on records that have been locked in an approval process when the values in the formula are ...
5
votes
1answer
1k views

Why can some tables be accessed in a subquery, but not in a regular query

I am going through code that does approvals and I see the following query: Select Id, TargetObjectId, Status, ( Select Id, ProcessInstanceId, ActorId, Actor.Name, StepStatus, Comments ...
5
votes
1answer
4k views

Approval Process: What status' indicate the record is Submitted for Approval

I am trying to detect whether a record is currently in an approval process. This is similar to this question but a different approach. I want to use the status of the youngest ProcessInstance to ...
5
votes
1answer
1k views

Must specify a {http://www.w3.org/2001/XMLSchema-instance}type during creating Approval process using metadata API

I am trying to create Approval process using Metadata API but unable to figure out what i am missing. One doubt is XML don't have any symbol why which me or Salesforce could identify on which object ...
5
votes
1answer
644 views

Approval process within a VF page in lightning experience does not work

I have a VisualForce page working fine in SF Classic that contains the approval process related list with this code: <apex:relatedList list="ProcessSteps" pageSize="3" /> When I switch to ...
5
votes
2answers
2k views

Single Click reply to Approval Emails

Currently, to approve any salesforce record through email, you have to reply to approval email using Approved/Yes and it gets approve. I just want to skip the step of writing "Approved/Yes" for ...
5
votes
3answers
3k views

Submitted user is also getting Reassign | Approve/Reject button on record

I am new to Approval process and i am facing a problem and don't know why is this coming and how to fix this. In my application opportunity has a field name is PIC(user look up) who can submit a ...
5
votes
1answer
2k views

order of execution issue?

I have the following logic implemented: approval process with a field update that set's a datetime on object X to now() trigger listening to a change of this datetime field on after update. That ...
5
votes
2answers
2k views

Approval process order of execution

What is the order in which the approval process and triggers execute? I have a trigger on a custom object and there is an update when the user submits the record for approval. Will the DML update ...
5
votes
1answer
2k views

Can Salesforce Platform License Users Approve via Email?

Looking for confirmation on whether users with the 'Salesforce Platform' license can approve via email. In the past, I've worked with customers where this worked, but getting an error in one customer'...
5
votes
2answers
1k views

The approval process references the workflow action FieldUpdate Some_Field_Update, which doesn't exist for the Some_Custom_Object__c object

While trying to deploy an approval process with the Salesforce Migration Tool, I get the following error: The approval process references the workflow action FieldUpdate Some_Field_Update, which ...
5
votes
3answers
4k views

Approval Process with Attachment & Email Response

Background: We have a custom Opportunity Object with a related Content List (documents like Solution Plans pertaining to an opportunity is uploaded into the Content via the related list). Few of the ...
4
votes
4answers
2k views

Remove Records From Approval Process In Bulk

I've got some records that were accidentally entered into an approval process that I want to remove - I keep running into governor limits when doing so. The approach I'm taking currently doesn't feel ...
4
votes
2answers
11k views

NO_APPLICABLE_PROCESS :No applicable process found!

// Insert an account Account a = new Account(Name='Test', annualRevenue=100.0); insert a; // Create an approval request for the account Approval.ProcessSubmitRequest req1 = ...
4
votes
1answer
9k views

Creating a multi-approver approval process

Does anyone know of a way of creating a multi-step approval process? I.e. When one approver approves it, case is sent to the next approver ( approver 2) then when approver 2 approves it, it goes to ...
4
votes
2answers
2k views

Manually select approver

I have created an Approval Process. In the approval step creation, at step 3, the approver has to be selected but I am not getting the option to let the user manually select the approver. The only ...
4
votes
2answers
2k views

How can i grant System Admin like permission to a user to Accept/Reject records

I need to create a custom setting like "Admin for Approval" and need to assign this setting to a users. Now every user that owns this custom setting will behave like Admin user for approval process ...
4
votes
1answer
6k views

Error when automatically submitting an approval process using code in APEX class - NO_APPLICABLE_PROCESS, No applicable approval process found

I have a trigger which automatically starts an approval process if an Opportunity has its stage updated to 'Closed Won'. if (o.StageName=='Closed Won') { Approval.ProcessSubmitRequest req = new ...
4
votes
2answers
2k views

About Approval Process Urgent

1) I want to know about ProcessInstance , ProcessInstanceSteps and ProcessInstanceWorkItem what is relation among them and when a record is sent for approval then I think some records are created ...
4
votes
2answers
649 views

Ordering approval process history items by CreatedDate DESC doesn't give the correct order of execution

It seems to be a quirk of ordering SOQL queries by CreatedDate that, if the records were created in the same second, the order returned by the SOQL query doesn't reflect the order of execution, as ...
4
votes
1answer
413 views

Can i get to know whether record was approved by salesforce login or email

Can i extract approval method like whether record was approved by salesforce login or through email. Thanks in advance
4
votes
2answers
188 views

Approval process - action

Currently Approve/ Reject actions are available in approval process. We have a requirement where user wants another option, like Escalate. Is it possible to add custom actions to approval process? if ...