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
Sam AlexSam Alex 

Package only a section in a Standard object page

Hi,

I have added a 4 custom fields to Account object. Then I have edited the current layout and add those 4 custom fields as a new section called "Account Sub Info". Now I want to package my 4 custom fields and the "Account Sub Info" section.

Means when user installs my package I want my custom fields and "Account Sub Info" section added to their Account layout.

How can I do this?

When packaging I tried to package the "Account Layout". When I try to install it it says the follwing.

Duplicate Name         The name "NewOpportunity" is already used on component type: Action. Please rename existing component.
Duplicate Name         The name "NewNote" is already used on component type: Action. Please rename existing component.
Duplicate Name         The name "NewTask" is already used on component type: Action. Please rename existing component.
Duplicate Name         The name "NewContact" is already used on component type: Action. Please rename existing component.
Duplicate Name         The name "NewCase" is already used on component type: Action. Please rename existing component.
Duplicate Name         The name "Account-Account Layout" is already used on component type: Page Layout. Please rename existing component.
Duplicate Name         The name "NewEvent" is already used on component type: Action. Please rename existing component.
Duplicate Name         The name "LogACall" is already used on component type: Action. Please rename existing component.
Duplicate Name         The name "Account.Billing" is already used on component type: Custom Button or Link. Please rename existing component.


Please Help and guide me how can I achive my requirement.

Thanks in advance...
Best Answer chosen by Sam Alex
Chidambar ReddyChidambar Reddy
You will never be able to do it by managed packages by just an installation
The only possible option is Metadata API

remember that you need to add remote site of your own SOAP API end point for that, which means it is hard for app exchange products
If you find a sharp developer they will get it done by 2-3 days


It is better to give the client instructions to add them
 

All Answers

Chidambar ReddyChidambar Reddy
You can't do this like this, as it will try to add standard fields agian to the pagelayout metadata

So, You may create a new pagelayout instead of using standard Account Layouts and add it to your package

or you may use Metadata API to update existing pagelayouts with your section ( I have done it, but it too complex)
Sam AlexSam Alex
Thanks for your reply Reddy. 

Could you please guide me through the steps that I have to follow to do this?

Thanks in advance.
Chidambar ReddyChidambar Reddy
do what? creating additional layout and adding it to the package? or using metadata API?

if it is adding pagelayouts 
Setup>Build> Customize> Accounts> Page Layouts> New

Choose existing page layout if you want to extend any of the existing layouts

give it a name 

Save it
Edit the layout created and create your section, save it and add it to the package


if you are about metadata API https://github.com/financialforcedev/apex-mdapi
Sam AlexSam Alex
Hi Reddy, I tried this with creating a new layout. After I install I has to edit the layout assignment. But it overrides the full layout. What I prefer is, add my section to the Account layout, which the user currently using.

Thats what I needed to do...
Chidambar ReddyChidambar Reddy
You will never be able to do it by managed packages by just an installation
The only possible option is Metadata API

remember that you need to add remote site of your own SOAP API end point for that, which means it is hard for app exchange products
If you find a sharp developer they will get it done by 2-3 days


It is better to give the client instructions to add them
 
This was selected as the best answer
Sam AlexSam Alex
Thanks Reddy. So I guess the good way to do this is package the classes, triggers, apps and ask user to add the section to their existing view.
Paradiso SolutionsParadiso Solutions


I did not needed this actions in my contact layout so i removed it and uploaded my app. And it works great. If you  do not need it than you can do the same.


Do let me know if you have any query