• Manuella Pinheiro
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
I am trying to write an apex trigger in a custom object, but i have one doubt. I have two custom objects, one called "Evaluation" and other called "Evaluation Result". They have a master-detail relationship, in which "Evaluation" is the master and "Evaluation Result" is detail. 
"Evaluation" contains a field with the total possible points of the evaluation (test / exam) and "Evaluation Result" contains a field for the student's grade to be recorded. I would like to implement a trigger on the "Evaluation Result" object before inserting the record, which verifies that the registered points do not exceed the total possible points of the related Evaluation. If the points recorded are greater than the total points possible for the assessment, an error should be returned. If they are less than or equal, the "Evaluation Result" record should be entered normally. So, i don't know how to compare the two fields and make the trigger works.