function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sravya sadhusravya sadhu 

Business Problem: There are two custom objects called Hearing and CAPA. Cortex/CAPA is the junction object between these two objects using lookup relationship.

Write a trigger to create a CAPA and Cortex/CAPA records when these conditions are met:
Confirmed Late Delivery field is ticked
Cortex/Order field equals Order
Delivered Status (Final) field = Delivered Late

When you are creating the CAPA record, populate the fields with these values:

CAPA field                                  Value

CAPA Status                              New
Date/Time CAPA created        Time record is created
Category                                     Corrective Action
Source                                         Late Delivery
Initial Description                       From hearing field Late Code (enter key)
                                                       From hearing field Late Code Sub Category (enter key)
                                                       From hearing field Reason for Late Delivery (enter key)
Immediate Action Taken           Wording always:  Transcript merged and sent.
Employee (s) Involved                From hearing field Merger Responsible
Hearing Number (s)                    Wording always: See CAPA Cortex records

If a following fields changes value and the linked CAPA has a Status that is not Closed and CAPA Source of “Late Delivery”, Quality Team would like to know about it. For the purpose of this test, please send email to llau@fortherecord.com.
- When Hearing.Confirmed Late Delivery is changed to unticked
- When Delivered Status is changed to a value that is not "Delivered Late"
- When Late Code is changed
- When Late Code Subcategory is changed

Hints:
Create your own email template (text only) with appropriate subject.


How get start with this and could you please provide me the code . as iam not aware od triggers and how to write triggers
sites1.3909952495827087E12sites1.3909952495827087E12
Hi Neha,

Contact me  @ vunnamsfdc@gmail.com

Share ur login details.