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
NewInternNewIntern 

Update field 1 of Opportunity according to field 2 of Task

The field Subject of Task should define what value is fed into the Opportunity field Stage. When the subject field value changes to "Sub1" (example), I need the field Stage of Opportunity for Account_ABC to change to "Stage1" automatically.

 

How can I achieve this - a brief step by step on how to go about would be great. 

Best Answer chosen by Admin (Salesforce Developers) 
Ashish_SFDCAshish_SFDC

Hi Newintern, 

 

It is not possible to update a cross object field via a workflow.

Instead you can try writing a Trigger using Apex to Indentify the  scenarios and update the Field 2. 

 

Regards,

Ashish

All Answers

Deepak Kumar ShyoranDeepak Kumar Shyoran

Hi NewIntern,

 

You have to option to change the Stage of Opportunity according to Subject 

 

1:- Create a workflow with field update event.

2 - Write a trigger to update Opportunity stage according to the Subject.

 

According to me first approach is the best suits to you.

 

For more help on workflow visit http://ap1.salesforce.com/help/doc/en/customize_wf.htm

And for triggers visit http://wiki.developerforce.com/page/Apex_Code_Best_Practices

 

If this post helps you then hit kudus by clicking on star and accept my post as a solution to your question.

 

NewInternNewIntern

Thanks for your reply.

 

As far as workflows, my requirement is a so-called cross-object field update. And in order to be able to trigger field updates, the concerned fields have to possess a master-detail relationship.

   

See this for details: http://na15.salesforce.com/help/doc/en/workflow_cross_object_field_updates.htm

 

After reading that, I believe it may not be possible to implement the trigger via workflows.

Ashish_SFDCAshish_SFDC

Hi Newintern, 

 

It is not possible to update a cross object field via a workflow.

Instead you can try writing a Trigger using Apex to Indentify the  scenarios and update the Field 2. 

 

Regards,

Ashish

This was selected as the best answer
Deepak Kumar ShyoranDeepak Kumar Shyoran

I was not saying to implement a trigger via a workflow rather I suggest you two different approaches to implement that.

 

 

NewInternNewIntern
I understood well what you said. By "implement the trigger via workflows", I didn't mean apex triggers - I was referring to a generic trigger meaning field 1 updating field 2, that kind of trigger. So it turns out that there is only one approach here, unless you still insist that my requirement can be implemented with a workflow.
Deepak Kumar ShyoranDeepak Kumar Shyoran

No now I am not insisting you to solve your problem via workflow please solve it as Ashish suggests above.

NewInternNewIntern

Thanks Deepak and Ashish for your responses.