• Aniket Supe 6
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
Specifications
Write a trigger on Candidate object to do the following -
Name: OnCandidateHireDeactivateJob_Yourname
Job has a field called Active (checkbox), If job is active and Candidate for that Job is being hired, trigger should calculate total number of Candidates hired so far including the current one and check if it exceeds or equals to number of open position on the Job. If it exceeds or equals, the Job's Active fields should be set to false (unchecked) so the Job is taken out from Active Job lists hence Candidates can not apply for it anymore
Job manager should be allowed to hire n number of Candidates. Where n= Number of Open Positions. Throw error when Job Manager Hire Candidates beyond Number of Open Positions limit stating "Sorry, No vacancies available for this Job"

Once Job is deactivated, new Candidates should not be allowed to apply for particular deactivated job. Provide error for such Candidates who are applying for Deactivated Job stating "Sorry, Job does not exist"
If more than one Candidate is being hired for the Job at a time, throw an error for such 
Candidates stating "At a time only one Candidate can be hired for a Job"
 
Hi
I have a Custom Object, Content Object and ContentDocumet object. Custom Object is patent and content objects are child. 
My requirement is, In the custom object if the flag is True then conectDocument need to Transfer to Custom object. If the flag is flase then the contentDocument should be InActive.
Each custom Object have associate content Document record.
Please tell me how can we write a trigger? We have to write the trigger on custom object.