• Sam Lim
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
Hi folks. I'm running Conga to update 300 records (this isn't a lot). The update is simply to set single checkbox on 300 opportunities to "True" and create a Task. However, it appears that some process builders are interfering with the process after waiting a couple minutes, it looks like nothing has updated. When I look at the console I see this error quite often: "13:33:30:000 LIMIT_USAGE_FOR_NS Maximum CPU time: 15391 out of 10000 ******* CLOSE TO LIMIT" . 

If I de-activate 2 process builders, the update seems to work fine for the 300 records. Is there a way I can make this entire thing run more efficiently?

I've saved debug logs if anyone needs to see them.
I've been using "Action Plans V3 Unmanaged" for years.  However we just tried to undelete an account and found that "Action Plans V3" is blocking the undelete.  The error I get is this:
 
Unable to undelete 1 of the record(s) because:

The record may have already been undeleted or removed from the Recycle Bin
The record may have been orphaned by the deletion of the custom object
You may no longer have access to undelete the record(s)
A data integrity rule or Apex trigger would fail if the record was undeleted

  If I disable the trigger that came bundled with "Action Plans V3", I can undelete an account without any issues.

Has anyone else come across this problem?

Here's what the trigger code looks like:
 
trigger AccountTrigger on Account (before delete, after undelete) {
    
    set<ID>             aIds    = new set<ID>();
    List<String>        apIds   = new List<String>();
    List<ActionPlan__c> deletePermantently_apIds= new List<ActionPlan__c>();
    
    //Delete related action plans
    if ( trigger.isdelete ){
        for( Account a : trigger.old ){
            aIds.add( a.Id );
        }
    
        /* GET Action Plans to delete from recycle bin */
        deletePermantently_apIds = [ select Id, Name , LastModifiedDate from ActionPlan__c where Account__c in : aIds and isDeleted = true ALL ROWS ];
        
        if ( deletePermantently_apIds.size() >0 ){          
            Database.emptyRecycleBin(deletePermantently_apIds);
        }
    
        //Get all action plans associated with Accounts
        for( Account a : [Select (Select Id , isDeleted From Action_Plans__r) From Account a where Id in : aIds]){
            if (a.Action_Plans__r.size() >0 ){
                for(ActionPlan__c ap :a.Action_Plans__r ){                  
                    apIds.add(ap.Id);
                }
            }
        }
        if ( apIds.size() >0 ){     
            ActionPlansBatchDelete aPBatch = new ActionPlansBatchDelete(apIds, Userinfo.getUserId());
            Database.ExecuteBatch( aPBatch );
        }
    }
    
    //Undelete related action plans
    if ( trigger.isUnDelete ){
        Database.UndeleteResult[] unDel_errors;
        for( Account a : trigger.new ){
            aIds.add( a.Id );
        }
        list <ActionPlan__c> aPs = [ select Id, Name , LastModifiedDate from ActionPlan__c where Account__c in : aIds and isDeleted = true ALL ROWS ];
        
        try{
            if(ActionPlanObjectTriggerTest.isTest){
                //throw dmlException
                insert new Contact();   
            }
            
            unDel_errors =Database.undelete( aPs,false);
        } catch ( Dmlexception e ){             
            for (Account a: trigger.new){
                a.addError('You can not undelete an action plan whose related object is deleted.');
            }
        }
    }
    
}

Thanks in advance!  Any help would be greatly appreciated!

Sam.
Hi there. 

We're having trouble getting debug logs working for our developers.

we are not able to get the debug logs for rest call API. on the following sandboxes
1. test (cs21)
2. v2dev (cs4 instance)

We have a site named 'RestCalls' and all rest resources belong to this site. we also tried adding the guest user for restCalls, however, we won't be able to get the debug logs for the call we made for these rest API. 

one more interesting thing, in CS21 even debug logs for anonymous execution is not populated

any help would be greatly appreciated! 

Thanks so much!
Hi folks.

I'm fairly new to this forum and wanted to post a quick question:

I recently enabled the NPSP engagment plans on a custom object on both my test org and production orgs.  I noticed a strange behaviour:

1) create a new engagment plan template with 4 tasks in it
2) Go to the custom object where the engagment plan object is deployed and create a new engagment plan
3) Engagement plan is created but no tasks appear in the Open Activities
4) go back to the engagement plan template and click "Manage Template"
5) modify some random value and save
6) create a new engagement plan in the custom object
7) this time, the 4 tasks are created against this new engagement plan and they appear in the Open Activities list.
8) every new engagement plan after this works properly and creates the associated tasks

I've been able to reproduce this on both my test and production environments.  What's special about the "Manage Template" button which seems to unlock the engagement plan?

Any help would be greatly appreciated!

Thank you!

Sam.
I've been using "Action Plans V3 Unmanaged" for years.  However we just tried to undelete an account and found that "Action Plans V3" is blocking the undelete.  The error I get is this:
 
Unable to undelete 1 of the record(s) because:

The record may have already been undeleted or removed from the Recycle Bin
The record may have been orphaned by the deletion of the custom object
You may no longer have access to undelete the record(s)
A data integrity rule or Apex trigger would fail if the record was undeleted

  If I disable the trigger that came bundled with "Action Plans V3", I can undelete an account without any issues.

Has anyone else come across this problem?

Here's what the trigger code looks like:
 
trigger AccountTrigger on Account (before delete, after undelete) {
    
    set<ID>             aIds    = new set<ID>();
    List<String>        apIds   = new List<String>();
    List<ActionPlan__c> deletePermantently_apIds= new List<ActionPlan__c>();
    
    //Delete related action plans
    if ( trigger.isdelete ){
        for( Account a : trigger.old ){
            aIds.add( a.Id );
        }
    
        /* GET Action Plans to delete from recycle bin */
        deletePermantently_apIds = [ select Id, Name , LastModifiedDate from ActionPlan__c where Account__c in : aIds and isDeleted = true ALL ROWS ];
        
        if ( deletePermantently_apIds.size() >0 ){          
            Database.emptyRecycleBin(deletePermantently_apIds);
        }
    
        //Get all action plans associated with Accounts
        for( Account a : [Select (Select Id , isDeleted From Action_Plans__r) From Account a where Id in : aIds]){
            if (a.Action_Plans__r.size() >0 ){
                for(ActionPlan__c ap :a.Action_Plans__r ){                  
                    apIds.add(ap.Id);
                }
            }
        }
        if ( apIds.size() >0 ){     
            ActionPlansBatchDelete aPBatch = new ActionPlansBatchDelete(apIds, Userinfo.getUserId());
            Database.ExecuteBatch( aPBatch );
        }
    }
    
    //Undelete related action plans
    if ( trigger.isUnDelete ){
        Database.UndeleteResult[] unDel_errors;
        for( Account a : trigger.new ){
            aIds.add( a.Id );
        }
        list <ActionPlan__c> aPs = [ select Id, Name , LastModifiedDate from ActionPlan__c where Account__c in : aIds and isDeleted = true ALL ROWS ];
        
        try{
            if(ActionPlanObjectTriggerTest.isTest){
                //throw dmlException
                insert new Contact();   
            }
            
            unDel_errors =Database.undelete( aPs,false);
        } catch ( Dmlexception e ){             
            for (Account a: trigger.new){
                a.addError('You can not undelete an action plan whose related object is deleted.');
            }
        }
    }
    
}

Thanks in advance!  Any help would be greatly appreciated!

Sam.
Hi all,

I am running into the CPU time limit exceeded error when I try to bulk import data into our org. Because I don't have coding knowledge myself, I was hoping to use visual workflows instead. The data that we sync has up to 22 fields that have 0's and 1's for the field input and I want to change these into "Yes" and "No" picklist values. The reason that I didn't want to use a formula field is because sometimes we also manually create records and I wanted to be able to choose Yes/No values. I also couldn't use checkboxes as per the instructions I received. 

Here is process flow I created

User-added image

What I did is I created 22 action groups for each of the binary fields. The action group criteria was to check if the picklist value is a 0 or 1 and if so, it'll kick in the immediate actions.

Here is part of the error message I received below. It seems like it's running but it's just slow..? 
Flow Details
Flow Name: Listing_Workflow_for_Binary_Fields
Type: Workflow
Version: 3
Status: Active

Flow Interview Details
Interview Label: Listing_Workflow_for_Binary_Fields-3_pba__Listing__c
Current User: Keith Kiefer (005150000066qU6)
Start time: 1/22/2017 4:13 PM
Duration: 17 seconds

How the Interview Started
Keith Kiefer (005150000066qU6) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = null
myVariable_current = a091500001MLez0AAD
RecursiveCountVariable = 0.00

ASSIGNMENT: myVariable_waitStartTimeAssignment
{!myVariable_waitStartTimeVariable} Equals {!Flow.CurrentDateTime}
Result
{!myVariable_waitStartTimeVariable} = "1/22/2017 4:13 PM"

DECISION: myDecision
Executed this outcome: myRule_1
Outcome conditions: and
1. {!formula_myRule_1} (true) Equals true
Logic: All conditions must be true (AND)

DECISION: myRule_1_pmetdec
Executed this outcome: myRule_1_pmetnullrule
Outcome conditions: or
1. {!myVariable_old} (null) Is null true
Logic: One condition must be true (OR)

RECORD UPDATE: myRule_1_A1
Find all pba__Listing__c records where:
AssessmentsYN__c Equals 1
Id Equals {!myVariable_current.Id} (a091500001MLez0AAD)
Update the records’ field values.
AssessmentsYN__c = Yes
Result
All records that meet the filter criteria are ready to be updated when the next Screen or Wait element is executed or when the interview finishes.

RECORD UPDATE: myRule_1_A2
Find all pba__Listing__c records where:
AssessmentsYN__c Equals 0
Id Equals {!myVariable_current.Id} (a091500001MLez0AAD)
Update the records’ field values.
AssessmentsYN__c = No
Result
All records that meet the filter criteria are ready to be updated when the next Screen or Wait element is executed or when the interview finishes.

DECISION: myDecision2
Executed this outcome: myRule_3
Outcome conditions: and
1. {!formula_myRule_3} (true) Equals true
Logic: All conditions must be true (AND)

DECISION: myRule_3_pmetdec
Executed this outcome: myRule_3_pmetnullrule
Outcome conditions: or
1. {!myVariable_old} (null) Is null true
Logic: One condition must be true (OR)

RECORD UPDATE: myRule_3_A1
Find all pba__Listing__c records where:
AuctionYN__c Equals 1
Id Equals {!myVariable_current.Id} (a091500001MLez0AAD)
Update the records’ field values.
AuctionYN__c = Yes
Result
All records that meet the filter criteria are ready to be updated when the next Screen or Wait element is executed or when the interview finishes.

RECORD UPDATE: myRule_3_A2
Find all pba__Listing__c records where:
AuctionYN__c Equals 0
Id Equals {!myVariable_current.Id} (a091500001MLez0AAD)
Update the records’ field values.
AuctionYN__c = No
Result
All records that meet the filter criteria are ready to be updated when the next Screen or Wait element is executed or when the interview finishes.

I had a few questions regarding how the process builder operates I was hoping one of you could help me understand

1) Is there a difference between the criteria for the action group and the criteria for the immediate action? Since the flow evaluates all the actions regardless, I'm not sure if this makes much of a difference. 
2) Does flow recursion significantly increase the CPU time?
3) I was also thinking of making parallel PB flows to make the workflow look more organized on the back end. Is that okay or would it just cause more problems for me in the long run?

Thanks for reading. I might be missing a few pieces due to a lack of coding knowledge so any insight would be greatly appreciated!

Receiving the following errors when trying to update from v. 1.25 to v. 3. What are the proper steps to upgrading versions?

 

Duplicate RelationshipNameCustom Field DefinitionsThe relationship name "R00NR0000000VccFMAS__r" is already used by custom field APTaskTemplate__c.Action_Plan__c. Please rename existing relationship name.
Duplicate RelationshipNameCustom Field DefinitionsThe relationship name "R00NR0000000VaVDMA0__r" is already used by custom field APTTaskTemplate__c.APTTaskTemplate__c. Please rename existing relationship name.
Duplicate RelationshipNameCustom Field DefinitionsThe relationship name "R00NR0000000Vd65MAC__r" is already used by custom field APTTaskTemplate__c.User__c. Please rename existing relationship name.
Duplicate RelationshipNameCustom Field DefinitionsThe relationship name "R00NR0000000VcWbMAK__r" is already used by custom field APTaskTemplate__c.APTaskTemplate__c. Please rename existing relationship name.
Duplicate RelationshipNameCustom Field DefinitionsThe relationship name "R00NR0000000Vd7NMAS__r" is already used by custom field APTaskTemplate__c.User__c. Please rename existing relationship name.
Duplicate RelationshipNameCustom Field DefinitionsThe relationship name "Action_Plans__r" is already used by custom field ActionPlan__c.Account__c. Please rename existing relationship name.
Duplicate RelationshipNameCustom Field DefinitionsThe relationship name "R00NR0000000VbUtMAK__r" is already used by custom field ActionPlan__c.Action_Plan_Template__c. Please rename existing relationship name.
Duplicate RelationshipNameCustom Field DefinitionsThe relationship name "Action_Plans__r" is already used by custom field ActionPlan__c.Action_Plan__c. Please rename existing relationship name.
Duplicate RelationshipNameCustom Field DefinitionsThe relationship name "R00NR0000000VZZ8MAO__r" is already used by custom field ActionPlan__c.Contact__c. Please rename existing relationship name.
Duplicate RelationshipNameCustom Field DefinitionsThe relationship name "R00NR0000000VZZDMA4__r" is already used by custom field ActionPlan__c.Lead__c. Please rename existing relationship name.
Duplicate RelationshipNameCustom Field DefinitionsThe relationship name "R00NR0000000VZZIMA4__r" is already used by custom field ActionPlan__c.Opportunity__c. Please rename existing relationship name.