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
Mona KawaleMona Kawale 

I want trigger for this scenario

Create an Object Employee: Name, Project Name, Start date, end date, Status (Available, Busy) Create a child object Contract with Project name, start date, end date, employee (lookup) , primary ( check box ) (Here you have to write trigger) as soon as new contract is created under an employee, employee record should get updated ( Start date, end date, Status) If that employee already have another active contract then based on primary contract, data should get updated on Employee
PriyaPriya (Salesforce Developers) 
Hey Mona,

Have you already created the objects in your org ?

There is already a standard object 'Contract'. Instead of creating a new you can use that. 

As your requirement is to update the parent record whenever any child is created or updated, then refer this link where similar scenario has been explained using trigger :-

https://developer.salesforce.com/forums/?id=906F0000000kIzEIAU
 

Kindly mark it as the best answer if it works for you.

 

Thanks & Regards,

Priya Ranjan