• vikas vickyy
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Hi i have a two custom objects one is employe__c and another one is comapny_report __c which doesnot have any relationship.
for employe__c i have a lookup relationship with Department__c 
for Departement__c i have lookup relationship with Company__c
and for company_report__c i have a lookup relationship with Department__c  and Company__c
 comapny__c has only one record with ABC company
and there are three Departments in Department__c 
Department 1
Department 2
Department 3
for the same company which has been selected from Parent Object Company

In employee__c object i have fields
EmpName;
Department which is selected from the parent object
Joining Date

In company_report__c i have fields
Name with autonumber;
Departement  ---> lookup relation with Departement__c
company ---> lookup relation with company__c
Quarter
Employee Count
Year

My requirment is if i created a record in employe__c with name departement and joining date  automatically record need to be created in the comapny_report__c  
I can create it.

But when i create an another record in the emp object with name and same department and same Quarter which is between 01 Jan to 31 Mar 2019 in company_report__c this existing record which has been created earlier should be updated with the count 2 previosuly which is one