0
votes

I would like to ask for some help. I am new to APEX and I face the problem which APEX trigger seems to be a solution. I would need a trigger in Salesforce which would update the field located in Users object (standard object) using the value from Holidays Remaining field from Staff object (custom object). In other words, what is populated in Holidays Remaining in Staff it should be copied to the field called holidays Remaining in the Users level. Could anyone help me with that please?

1

1 Answers

0
votes

So you want to mirror the field Staff__c.Remaining_Holidays__c with the field User.Remaining_Holidays__c?

At what point do you want this to happen? Every time somebody updates (clicks save) a Staff__c record? If so, a trigger can help you. If this is supposed to happen automatically and periodically you must write an apex class and schedule the execution of that code (see http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm ).

You also need to tell us how the Staff__c object is related to the User object?