• Ridhima Saxena 20
  • NEWBIE
  • 10 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies
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);
Hii Team,
I want to know how can I make my customtab visible on an application.Because on the creation of object it is creating customTab and shown inside tablist(setup) but not on an application. How to do it.
Here is my code for customtab
MetadataService.CustomTab customTab = new MetadataService.CustomTab();
    customTab.FullName = objname + '__c'; 
    customTab.Motif = 'Custom70: Handsaw'; 
    customTab.CustomObject = true;    
    fields.add(customTab); 
service.createMetadata(fields); 

Its Urgent.Help me ASAP

Thanks in advance
Hii Team,
I am new to salesforce and my requirement is that i have created custom object dynamically so i am creating custom fields as well but when my object is being created then it is not creating fields.here is my code

@AuraEnabled
 public static string createobject(String objname)
{
    string labelname = objname; //put parameter into string
MetadataService.MetadataPort service = new MetadataService.MetadataPort();  
service.SessionHeader = new MetadataService.SessionHeader_element();
service.SessionHeader.sessionId = UserInfo.getSessionId();

List<MetadataService.Metadata> fields = new List<MetadataService.Metadata>();
MetadataService.CustomObject  customobject = new MetadataService.CustomObject();
objname = objname.trim();
objname = objname.replace(' ', '_');
    //remove space from lead and tail
customobject.fullName = objname +'__c';
customobject.label = labelname;
customobject.pluralLabel = labelname;
customObject.nameField = new MetadataService.CustomField();
customobject.nameField.type_x = 'Text';
customobject.nameField.label = 'Dashboard Name';
customobject.deploymentStatus = 'Deployed';
customObject.sharingModel = 'ReadWrite';
fields.add(customobject);


//Here below i am getting custom field how can i resolve it help me
MetadataService.CustomField customField3 = new MetadataService.CustomField();
customField3.fullName = objname +'.MenuSequence__c';                                 //parameterized objname
customField3.label = 'Menu Sequence';
customField3.type_x = 'Number';
customField3.precision = 18;
customField3.scale = 1;
customField3.unique = false;
system.debug('Menu Sequence-' +customField3);   
    
MetadataService.CustomField customField4 = new MetadataService.CustomField();
customField4.fullName = objname +'.Active__c';
customField4.label = 'Active';
customField4.defaultvalue = 'false';
customField4.type_x = 'Checkbox';
fields.add(customField3);
fields.add(customField4);
 service.createMetadata(fields);
 return objname;   


Please check and tell me my error ASAP
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
Hii Team,
I want to know how can I make my customtab visible on an application.Because on the creation of object it is creating customTab and shown inside tablist(setup) but not on an application. How to do it.
Here is my code for customtab
MetadataService.CustomTab customTab = new MetadataService.CustomTab();
    customTab.FullName = objname + '__c'; 
    customTab.Motif = 'Custom70: Handsaw'; 
    customTab.CustomObject = true;    
    fields.add(customTab); 
service.createMetadata(fields); 

Its Urgent.Help me ASAP

Thanks in advance
Hii Team,
I am new to salesforce and my requirement is that i have created custom object dynamically so i am creating custom fields as well but when my object is being created then it is not creating fields.here is my code

@AuraEnabled
 public static string createobject(String objname)
{
    string labelname = objname; //put parameter into string
MetadataService.MetadataPort service = new MetadataService.MetadataPort();  
service.SessionHeader = new MetadataService.SessionHeader_element();
service.SessionHeader.sessionId = UserInfo.getSessionId();

List<MetadataService.Metadata> fields = new List<MetadataService.Metadata>();
MetadataService.CustomObject  customobject = new MetadataService.CustomObject();
objname = objname.trim();
objname = objname.replace(' ', '_');
    //remove space from lead and tail
customobject.fullName = objname +'__c';
customobject.label = labelname;
customobject.pluralLabel = labelname;
customObject.nameField = new MetadataService.CustomField();
customobject.nameField.type_x = 'Text';
customobject.nameField.label = 'Dashboard Name';
customobject.deploymentStatus = 'Deployed';
customObject.sharingModel = 'ReadWrite';
fields.add(customobject);


//Here below i am getting custom field how can i resolve it help me
MetadataService.CustomField customField3 = new MetadataService.CustomField();
customField3.fullName = objname +'.MenuSequence__c';                                 //parameterized objname
customField3.label = 'Menu Sequence';
customField3.type_x = 'Number';
customField3.precision = 18;
customField3.scale = 1;
customField3.unique = false;
system.debug('Menu Sequence-' +customField3);   
    
MetadataService.CustomField customField4 = new MetadataService.CustomField();
customField4.fullName = objname +'.Active__c';
customField4.label = 'Active';
customField4.defaultvalue = 'false';
customField4.type_x = 'Checkbox';
fields.add(customField3);
fields.add(customField4);
 service.createMetadata(fields);
 return objname;   


Please check and tell me my error ASAP