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
RivoRivo 

Update Date field trigger

I have been told that this can only be done using Triggers and unfortunately I have zero developer skills so am relying / pleading / grovelling to the community for some assistance.....<begging emoticon>

 

The scenario I have is I have a custom object called Meeting_Call_Report__c. This was created as the standard SFDC meeting logging functionality doesn't meet our requirements. This object has lookup relationship fields to Account, Contact and Opportunity, however not all records within the object will be linked to an Opportunity. They will however always relate to an Account and Contact.

 

On the Opportunity object I have a date field called Last_Activity__c

 

I need the Opportunity.Last_Activity__c field updated with date from the latest Meeting_Call_Report__c record upon insertion.

 

Unfortunately the only thing I know is I have to write a trigger in my dev sandbox, it has to be tested (eek!) and then deployed using a third party app (double eek!).

 

Can anyone help?

bob_buzzardbob_buzzard

This is indeed something that can be done with triggers.  I'd suggest you read some of the resources available to gain an understanding of how to write triggers, otherwise you'll be a hostage to fortune if you need to change anything.  The following link covers writing, testing and deploying:

 

http://www.crmverse.com/write-your-first-salesforce-com-apex-trigger-overview/

 

 

kyle.tkyle.t

bob is right, you don't want to fall into a place where you create a trigger but have no idea how to actually fix it if something were to break.  With that being said, I can at least give you an outline of how I might proceed with this.

 

1.Loop through the Meeting_Call_Reports in the trigger. 

2. If the opportunity is not null then set Opportunity__r.Last_Activity__c to the date from the Meeting_Call_Report and add the Opportunity to a list.

3. update the opportuntiies

 

When you write a trigger you need to be mindful of the fact that triggers can be fired in bulk.  If you load 500 Meeting_Call_report records there will be three batches (200/200/100) that need to be processed.