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
Ashritha SAshritha S 

Creating Page Layout for case object using metadata api

Hi,

While creating page layout using metadata api
MetadataService.LayoutItem layoutItem9 = new MetadataService.LayoutItem();
    layoutItem9.behavior = 'Required';
    layoutItem9.field = 'Contact';
    layoutColumn.layoutItems.add(layoutItem9);

I am getting the error  Layout must contain an item for required layout field: ContactId . But I have included the required field COntact name using the above mentioned code. Please suggest a solution
ShashankShashank (Salesforce Developers) 
You may have to add the ContactId field as well to the layout.