+ Start a Discussion
Ridhima Saxena 20Ridhima Saxena 20 

How to write code for customtab using metadata API??

Hi Developers,
I am new to salesforce. My requirement is to create custom tab using metadata API as i have created custom objects.Please answer as soon as possible but not in xml package
Best Answer chosen by Ridhima Saxena 20
SFDC_SaurabhSFDC_Saurabh
below is a excerpt from below link 
CustomTab expenseTab = new CustomTab();
    expenseTab.setFullName("ExpenseReport__c");
    expenseTab.setMotif("Custom70: Handsaw");
    expenseTab.setCustomObject(true);
    AsyncResult[] arsTab =
        metadataConnection.create(new Metadata[] {expenseTab});

https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_profile.htm
You can mould it as per your requirements