+ Start a Discussion
sdfasdsdfasd 

how to udpadate the opportunity field once product is created?

i created  field in Opportunity object    i.e Renewal Date.

 

once Product is added  to Particual Opportunity record  then automatically updated Renewal Date with Today Date .using workflow. please help me.......................................

Best Answer chosen by Admin (Salesforce Developers) 
Mitesh SuraMitesh Sura

Well , you do not need code for this. Work flow should be good enough. 

 

Have a roll up field in Opportunity, that will be count of total Products, lets say field name is "Number of Products". 

Now have a workflow and fire only if that field is changed. 

 

Rule Criteria:  ISCHANGED(Number_of_Products__c) 

 

have a field update for this workflow. 

 

Just select the field to update and Specify new field value as: TODAY() 

 

hope this helps

 

SF Partner

 

All Answers

Burton024Burton024

Use a trigger, not workflow.

 

Go to Your Name->Settings->Customize->Products->Triggers,  then create a new trigger using the 'after insert'.

 

Here is a simple example: http://boards.developerforce.com/t5/General-Development/APEX-Trigger-Simple-Field-Update-Using-a-formula-field/td-p/181522

 

Mitesh SuraMitesh Sura

Well , you do not need code for this. Work flow should be good enough. 

 

Have a roll up field in Opportunity, that will be count of total Products, lets say field name is "Number of Products". 

Now have a workflow and fire only if that field is changed. 

 

Rule Criteria:  ISCHANGED(Number_of_Products__c) 

 

have a field update for this workflow. 

 

Just select the field to update and Specify new field value as: TODAY() 

 

hope this helps

 

SF Partner

 

This was selected as the best answer