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
Henry SabiaHenry Sabia 

Apex trigger case record type = account record type

New to Apex...

Need to create an Apex trigger to make the case_record_type the same as the account_record_type upon creation of a new case.

Use case is that we want to use specialized case layouts depending on the account type.

Thanks
Henry SabiaHenry Sabia
This gives me a compile error but might help explain what I am trying to go.

trigger updatefields on Case (before update) {

    Case [] cases = Trigger.new;
    if (case.recordtypeid=NULL){
    (case.recordtypeid) = (account.recordtypeid);
}
}