Can you please expand on what you are trying to do? This would be a relatively simple trigger if all you are doing is comparing a field on a object and if it is equal to a known value rejecting it. For example:
trigger Timecard on Timecard__c (before update) {
for (Timecard__c timecard: Trigger.new) {
if (timecard.Status__c != 'Rejected') {
timecard.addError('Timecards can only be updated to be rejected');
}
}
}
However, without more information about your object and a little more about the data in the object, that is the best I can do.
However, without more information about your object and a little more about the data in the object, that is the best I can do.