I need to update my Opp Stage based on a related object DocuSign Status. When the Envelope Status = 'Completed' on the DocuSign Status object, I need my Opp Stage to update to 'SOW Received'. This used to be on a custom object and worked fine, now our business has moved the DocuSign function to the Opp object, and it doesn't update. I have tried a process builder, but it fails because it sees a null value. I thought I could create a trigger:

trigger opportunityStage on Opportunity (before insert, before update)
    {for(Opportunity o : trigger.new)
        {Opportunity__r.dsfs__Envelope_Status__c = 'Completed';
         {o.StageName = 'SOW Received';}          

But this doesn't recognize the related object field (Opportunity__r.dsfs__Envelope_Status__c). Any suggestions on how I can solve for this?

  • 1
    If the field is changing in the Docusign Status object, then typically you would write the trigger on that object, not on opp. – David Cheng Mar 29 '19 at 23:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.