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
Bansal 4Bansal 4 

delete page layout from managed package

I used metadata api to delete page layout of custom object from managed package. While testing on dev org, it deleted layout, but on subscriber org(where package in installed) no layout was deleted. 
Should I add any permission or any other code to delete layout.
Please reply on same.
NagendraNagendra (Salesforce Developers) 
Hi Bansal,

Sorry for this issue you are facing.

May I request you please confirm who is deleting the page layout component?

Only the user who installed the package or the user who has a subscription to the package can only delete the page layout component.

Also, please check if Create App Exchange permission is enabled for the user who is deleting the component.

Hope this helps.

Kindly mark this as solved if the reply was helpful.

Thanks,
Nagendra
Bansal 4Bansal 4
Hi,
I written apex code using metadata api to delete page layout from custom object in managed package and added new layout. Old Layout is deleted and new layout is properly assigned to all profiles. Now when I open any record, still record is open with old layout and related list is not visible. And also if I edit this record and try to save it, throws error and does not allow to save this. Your help is appreciated.