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
Laura BrewerLaura Brewer 

Help with Field Update Rule

I'm trying to write a rule that will update a field based on the following criteria:

Update a checkbox on Opportunity to TRUE when an Event of a certain Record Type is created.

I have an Event Record Type called "Demo".  When a "Demo" is created and associated to an Opportunity, I want a checkbox on the corresponding Opportunity to update to TRUE.

Any thoughts.....?

 
dlampdlamp
Laura, unfortunately I don't think you can do this with just a WFR + Field Update.  As you can see here (https://help.salesforce.com/HTViewHelpDoc?id=workflow_cross_object_field_updates.htm&language=en_US) Event is not a supported object for cross-object updates on Opportunity.  The same also looks to be true for the new Spring15 Process Builder, although perhaps here you could resort to including a Visual Workflow.

But you'll probably just want to implement this field update with a small bit of Apex code.  I'd start with a hook in the Event trigger's afterinsert(), and then just update the Opportunity you find via the new Event's WhatID (RelatedTo) field value.

One small nit.  You say you want this on create, but if the Event can be created without a lookup to Opportunity, and the Opportunity reference can be added later, then you might also want to handly the potential null WhatID as well as the update condition in the Event trigger's afterupdate().