function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ZombiePrawnZombiePrawn 

Internal server error in Approval Process when "Duplicate mgmt tool" is applied..

Hi,

our approval process when creating an account record is working fine until we apply the duplicate mgmt tool using the save(ignorealert) option, we're receiving the "internal server error". do we need to modify our approval logic or  reconfigure the setup placed in dupli mgmt tool?
appreciated your help..
public void genRequest(Account accsub){
        Map<Id, Integer> submitCounter = new Map<Id, Integer>();
        Integer count = 0;
        try{
                Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();
                req1.setComments('Submitting request for approval.');
                req1.setObjectId(accsub.id);
                Approval.ProcessResult result = Approval.process(req1); 
                System.assert(result.isSuccess());        
                System.Debug('IN APPROVAL' + accsub.id);
                System.debug('Submitted for approval successfully: '+result.isSuccess());
              
                
            }
        Catch(Exception e) {    
            System.debug(e);                   
        }
    }
Save(Ignore Alert)

Thanks,
 
ZombiePrawnZombiePrawn

Good day sura,

the Duplicate management feature right under the administration setup. the tool is working fine and we already set it up for other objects.
but for our object with an approval logic, we're getting the internal server error right when i click the Save(ignorealert).


Thanks,
 
surasura
you can configure the duplicate managment tool  based on your requirment .
if you do not want duplicate check you can deactivate the matching rule also you can configure whether or not to allow duplicate records ,please refer this link for more details http://https://help.salesforce.com/apex/HTViewHelpDoc?id=managing_duplicates_overview.htm
surasura
could you provide a screen shot of exact error . 
ZombiePrawnZombiePrawn
Hi Sura,

Appreciated your time. our requirement is also to apply the duplicate alert rule to the said object, so deactivation is not our option but to identify why we're having the "internal server error" on the code provided above 

Thanks,
 
surasura
are you sure you are inserting the account record before calling the  Approval.ProcessResult result = Approval.process(req1); . because I cant  see a insert statement in your code 
ZombiePrawnZombiePrawn
Hi Sura,

i did not paste here the insert code.ive only provided the code in approval, thinking that there would be something missing in the approval logic.
but this is working when the duplicate rule is deactivated. so im thinking there is something interrupting with saving the records.

error displayed below:
User-added image

Thanks,
 
surasura
try to debug your code with system.debug or system.assert  stmts and debug logs to verfiy account record actually saves and exact location where the error occurs .