+ Start a Discussion
azhar khasimazhar khasim 

Need to write a Trigger on Opportunity and Project(Custom Object) for Creating records.

Need help in writing triggers between Opportunity and Project(Custom Object) for creating records.

I have three objects.
Opportunity (Three Checkboxes)(Temp 60, Temp 90, Temp 120)
      ||
Project (Record Type -- ST Templates)(Temp 60, Temp 90, Temp 120)
      ||
MIlestones


criterias..,

1. When the Opportunity Stage is ClosedWon, create a Project.
2. The opportunity has three checkboxes names
    (Three Checkboxes -- Temp 60, Temp 90, Temp 120)
3. The project has Record Type as (Record Type -- DC Project Templates)
       These are the ST templates (Means records in Project)-- Temp 60, Temp 90, Temp 120.

Now, Whenever Opportunity is ClosedWon and Checkbox Temp 60 is true.
Create a New Project with Selecting Temp60 as the default template for Project because Temp 60 has Child Records(28 Milestones in Milestones Object.)



Please Help me in providing a trigger for two objects.

Trigger :
Opportunity Stage:  ClosedWon && Temp 60 Checkbox is true
Create a Project with  Dc Project Template (Temp 60) as default.

If I select Temp 60 checkbox in Opportunity Temp 60 Record from Project is to be the default.

If I select Temp 90 checkbox in Opportunity Temp 90 Record from Project is to be the default.

If I select Temp 120 checkbox in Opportunity Temp 120 Record from Project is to be the default.


Please Provide me the trigger for this scenario.

With Regards,
Azar Khasim.