You need to sign in to do that
Don't have an account?
Ridhima Saxena 20
How to write name of aura component inside custom tab using metadata API?
Hii Team,
My requirement is whenever I create custom object it should create custom tab with aura component.
Here is my code.Hoow to write my aura component name to display on tab
MetadataService.CustomTab customTab = new MetadataService.CustomTab();
customTab.FullName = objname + '__c';
customTab.Motif = 'Custom70: Handsaw';
customTab.CustomObject = false;
customTab.auraComponent = 'c:dashboardcreationForm'; (this thing how to write to call my aura component)
fields.add(customTab);
system.debug('CustomTab--' +customTab);
service.createMetadata(fields);
My requirement is whenever I create custom object it should create custom tab with aura component.
Here is my code.Hoow to write my aura component name to display on tab
MetadataService.CustomTab customTab = new MetadataService.CustomTab();
customTab.FullName = objname + '__c';
customTab.Motif = 'Custom70: Handsaw';
customTab.CustomObject = false;
customTab.auraComponent = 'c:dashboardcreationForm'; (this thing how to write to call my aura component)
fields.add(customTab);
system.debug('CustomTab--' +customTab);
service.createMetadata(fields);
Also, note that as per the documentation, you can only populate one of the following fields. I see you are already populating CustomObject ( customTab.CustomObject = false;) so you cannot use auraComponent
Only one of these fields can have a value set:
auraComponent
customObject
flexiPage
lwcComponent
page
scontrol
url
When you add the force:appHostable interface to an Aura component to allow it to be used as a custom tab in Lightning Experience you will use it's name in the auraComponent field. For example
customTab.auraComponent = 'simpleTab';
If you find this information helpful, please mark this answer as Best. It may help others in the community
Thanks,
Anudeep