I had two custom objects Organization__c (parent) and Employee__c (child) which were related using lookup relation ship [lookup:orgnitation__c]
.
fields for Organization__c:
name, total_slary__c, min_salary__c,max_salary__c
fields for employee__c: Salary__c
Now for example, if i have records like
EmployeeAutoNumber ---------Organization Name------Salary__c
emp01-----------------------------------H.R---------------------100
emp02-----------------------------------H.R---------------------200
emp03-----------------------------------H.R----------------------50
emp04-----------------------------------H.R----------------------25
emp05-----------------------------------Labour------------------625
emp06-----------------------------------Labour------------------825
emp07-----------------------------------Electricity-------------925
emp08-----------------------------------Electricity-------------250
how can i write a trigger to update the min_salary__c or max_salary__c in organization__c based on the salaried of the respective organization? In the above example the min_salary__C for H.R organization is 25 and max_salary__c is 200.How can i update in the HR organization using triggers ?