Skip to main content
Lauren Carrasquillo (Vendr) 님이 #Task Object에 질문했습니다

I want to only show specific task fields when the type of task = a value. 

 

I have created a Record Type and a new Page Layout for that record type. I have assigned the record type to the new page layout assignment also. However, I cannot see how to set criteria based on task fields. 

 

Example: IF Task field 

 

#Task ObjectType = "Expiring Subscriptions", THEN update page layout to Exp. Subs page layout.

답변 1개
  1. 2021년 7월 14일 오후 2:46

    If you are using a trigger, you can get the record types Id using:  

    ID taskRecordTypeId = Schema.SObjectType.Task.getRecordTypeInfosByDeveloperName().get('Record Type Name').getRecordTypeId();

    And now you can use it to assign a recordtype.

    for(Task t: Trigger.new){

    if(t.type = a){

    t.RecordTypeId = TaskRecordTypeId;

    }

    }

0/9000