Skip to main content
Hello all,

I am hoping to create a workflow rule that will assign tasks for various things. When these tasks are marked as complete, I'd like to trigger an update to a custom object that checks a checkbox to show it's been completed as well as update the date. I understand this cross object update is not possible with workflow.

Could this be possible with either process builder/flows/triggers or some combination? I am a point and click administrator at this point so I don't have any coding knowledge. Any help would be appreciated!

Thank you,

Blair
2 réponses
  1. 11 mai 2015, 18:33
    Hi Blair,

    You can use the below trigger to update the checkbox on custom object. Is that task in any way related to the custom object?

    trigger TaskTrigger on Task (after update) {

      List<Custom_object__c> CustInsList = new List<Custom_object__c>();

      for(Task t : Trigger.New){

        if(t.Status == 'Complete' && t.Status != Trigger.oldMap.get(t.Id).Status){

           Custom_object__c c = new Custom_object__c();

           c.checkbox = true;

           CustInsList.add(c);

        }

      }

      if(!CustInsList.isEmpty()){

        try{

            update CustInsList;

        }

        Catch(DMLException de){

           System.debug('Exception Occurred on insert of Custom object: '+ de);

       }

      }

    }

    Thanks

    Kumar
0/9000