• Melissa Shook 16
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
We have 2 objects- Study Participant and Prescription- Prescription is the detail of a Master-detail relationship between the 2. The we have 2 workflow rules that update the Study Participant when a new Prescription is added. 
Workflow 1: If the Prescription has an "I" in the Insurance__c field then it updates the Study Participant Insurance_Status__c field to "Covered". 
Workflow 2: If the Prescription has anything but an "I" code the Study Participant Insurance_Status__c is updated to "Not Covered". 
This works fine except when there are 2 or more on the same day. In cases where there are multiple Prescriptions in the same day- as long as one of them has an "I" code, we want to say they are "Covered". That works fine if the last record inserted on that day is the "I" code but if not it doesn't work correctly. 

Any ideas?
I am trying to write a trigger to send an Echosign Agreement based on an EchoSignTemplate whenever a new Opportuinity is created. I am not able to get it working. I am new to this so any help would be greatly appreciated.  Here is my code:

trigger SendOppAgreement on Opportunity (after insert) {
    String templateId = 'a3CA000000059zP';
    for( Opportunity opp : Trigger.new ) {
        String masterId = opp.Id;
        
        Send_Esign_Methods.sendAgreement(templateID, masterID);
    }
}


global class Send_Esign_Methods 
{  
      @future (callout=true)
      
    public static void sendAgreement (Id templateId, Id  masterid) {
    
       echosign_dev1.AgreementTemplateService.load( templateid , masterid );
            
  }
}

 
I recently installed EchoSign for Salesforce and finally have things up and running with my users being able to send documents with a single click. Now, I need to take it one step further and figure out a way to send a contract without user interaction, at the time a record (Lead) is created. 

Adobe talks about workflows in thier marketing but offers no obvious direction as to how to go about setting them up. As far as I can tell, this is not something which is a part of standard workflows so it sounds like I'm going to have to write another trigger??

Well, I've written a few triggers in the past but I am far from an expert. I can do it, I just need something to show me the way... I would appreciate any links or code snippets that anyone could offer. I'm sort of lost at this point and Adobe help & support is basically non-existent.

Thank you!

PS: I know how to find the basic Salesforce help guides on Apex Triggers - I need something specific to EchoSign. Thanks!