• mani tool
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 9
    Replies
We are trying to display the Bell curve(s-curve) from the data we have by using the Normaldistribution Formulae.

User-added image

We are able to calculate the Normal distribution for Probability density by using Math class in Salesforce, but we also require remaining 2 formulaes to calculate.

Any one Please help on this.
I'm implementing the metadata services to create the custom objects and fields and i unable to assign default values to metadata custom fields at the time of creation.

Is there any particular way how to assign the values.
im creating custom object and fields using metadata api, and im getting below error:


Methods defined as TestMethod do not support Web service callouts.

how to solve this
Hi,

I have created the object in Salesforce using metadata api, i tried using metadata to create a tab for it but the tab is not visible in Salesforce.

MetadataService.MetadataPort service = new MetadataService.MetadataPort();  
service.SessionHeader = new MetadataService.SessionHeader_element();
service.SessionHeader.sessionId = UserInfo.getSessionId();
//system.debug('session id:'+UserInfo.getSessionId());
System.debug(UserInfo.getOrganizationId()+''+UserInfo.getSessionId().SubString(15));
//system.debug('session id:'+UserInfo.getSessionId());
System.debug(UserInfo.getOrganizationId()+''+UserInfo.getSessionId().SubString(15));
MetadataService.CustomTab  customField2 = new MetadataService.CustomTab();
        customField2.fullName = 'mani_pick__c';
        //customField2.icon='Heart';
        customField2.type = 'CustomTab';
        customField2.motif='Custom1:Heart';
        customField2.customObject=true;

List<MetadataService.SaveResult> results = service.createMetadata(new MetadataService.Metadata[] { customField2 });

Can anyone tell me where i am missing.
I have a custom field, I have to edit the field using metadata api.
 I used below code :

MetadataService.MetadataPort service = new MetadataService.MetadataPort();  
service.SessionHeader = new MetadataService.SessionHeader_element();
service.SessionHeader.sessionId = UserInfo.getSessionId();
//system.debug('session id:'+UserInfo.getSessionId());
System.debug(UserInfo.getOrganizationId()+''+UserInfo.getSessionId().SubString(15));    
        MetadataService.CustomField customField = new MetadataService.CustomField();
        customField.fullName = 'custom_create__c.TestField__c';
        customField.label='New Test Field Label';
        customField.type_x = 'Text'; 
        customField.length = 52;
        MetadataService.UpdateMetadata ut = new MetadataService.UpdateMetadata();
        ut.currentName='custom_create__c.TestField__c';
        ut.metadata= customField;
        MetadataService.AsyncResult[] results = service.updateMetadata(new List<MetadataService.updateMetadata> {ut});

Iam getting an error: "Invalid type: MetadataService.UpdateMetadata".
Can anyone plz suggest why im getting this error.
I have a custom field, I have to edit the field using metadata api.
 I used below code :

MetadataService.MetadataPort service = new MetadataService.MetadataPort();  
service.SessionHeader = new MetadataService.SessionHeader_element();
service.SessionHeader.sessionId = UserInfo.getSessionId();
//system.debug('session id:'+UserInfo.getSessionId());
System.debug(UserInfo.getOrganizationId()+''+UserInfo.getSessionId().SubString(15));    
        MetadataService.CustomField customField = new MetadataService.CustomField();
        customField.fullName = 'custom_create__c.TestField__c';
        customField.label='New Test Field Label';
        customField.type_x = 'Text'; 
        customField.length = 52;
        MetadataService.UpdateMetadata ut = new MetadataService.UpdateMetadata();
        ut.currentName='custom_create__c.TestField__c';
        ut.metadata= customField;
        MetadataService.AsyncResult[] results = service.updateMetadata(new List<MetadataService.updateMetadata> {ut});

Iam getting an error: "Invalid type: MetadataService.UpdateMetadata".
Can anyone plz suggest why im getting this error.
 
I am trying to create objects and fields dynamically using apex code, But I'm getting the error "Method does not exist or incorrect signature: void createService() from the type anon". I have deployed the metadataservice class and related classes in my Org. I try to create an object using below code:



 MetadataService.MetadataPort service = createService();
        MetadataService.CustomObject customObject = new MetadataService.CustomObject();
        customObject.fullName = 'Test__c';
        customObject.label = 'Test';
        customObject.pluralLabel = 'Tests';
        customObject.nameField = new MetadataService.CustomField();
        customObject.nameField.type_x = 'Text';
        customObject.nameField.label = 'Test Record';
        customObject.deploymentStatus = 'Deployed';
        customObject.sharingModel = 'ReadWrite';
        List<MetadataService.SaveResult> results =
            service.createMetadata(
                new MetadataService.Metadata[] { customObject });
        handleSaveResults(results[0]);

I have executed the above code and I got the error:  I am getting the error because I don't have Createservice() method in my metadataservice class. Can anyone help me how to fix this?
We are trying to display the Bell curve(s-curve) from the data we have by using the Normaldistribution Formulae.

User-added image

We are able to calculate the Normal distribution for Probability density by using Math class in Salesforce, but we also require remaining 2 formulaes to calculate.

Any one Please help on this.
I have a custom field, I have to edit the field using metadata api.
 I used below code :

MetadataService.MetadataPort service = new MetadataService.MetadataPort();  
service.SessionHeader = new MetadataService.SessionHeader_element();
service.SessionHeader.sessionId = UserInfo.getSessionId();
//system.debug('session id:'+UserInfo.getSessionId());
System.debug(UserInfo.getOrganizationId()+''+UserInfo.getSessionId().SubString(15));    
        MetadataService.CustomField customField = new MetadataService.CustomField();
        customField.fullName = 'custom_create__c.TestField__c';
        customField.label='New Test Field Label';
        customField.type_x = 'Text'; 
        customField.length = 52;
        MetadataService.UpdateMetadata ut = new MetadataService.UpdateMetadata();
        ut.currentName='custom_create__c.TestField__c';
        ut.metadata= customField;
        MetadataService.AsyncResult[] results = service.updateMetadata(new List<MetadataService.updateMetadata> {ut});

Iam getting an error: "Invalid type: MetadataService.UpdateMetadata".
Can anyone plz suggest why im getting this error.
I have a custom field, I have to edit the field using metadata api.
 I used below code :

MetadataService.MetadataPort service = new MetadataService.MetadataPort();  
service.SessionHeader = new MetadataService.SessionHeader_element();
service.SessionHeader.sessionId = UserInfo.getSessionId();
//system.debug('session id:'+UserInfo.getSessionId());
System.debug(UserInfo.getOrganizationId()+''+UserInfo.getSessionId().SubString(15));    
        MetadataService.CustomField customField = new MetadataService.CustomField();
        customField.fullName = 'custom_create__c.TestField__c';
        customField.label='New Test Field Label';
        customField.type_x = 'Text'; 
        customField.length = 52;
        MetadataService.UpdateMetadata ut = new MetadataService.UpdateMetadata();
        ut.currentName='custom_create__c.TestField__c';
        ut.metadata= customField;
        MetadataService.AsyncResult[] results = service.updateMetadata(new List<MetadataService.updateMetadata> {ut});

Iam getting an error: "Invalid type: MetadataService.UpdateMetadata".
Can anyone plz suggest why im getting this error.
 
I am trying to create objects and fields dynamically using apex code, But I'm getting the error "Method does not exist or incorrect signature: void createService() from the type anon". I have deployed the metadataservice class and related classes in my Org. I try to create an object using below code:



 MetadataService.MetadataPort service = createService();
        MetadataService.CustomObject customObject = new MetadataService.CustomObject();
        customObject.fullName = 'Test__c';
        customObject.label = 'Test';
        customObject.pluralLabel = 'Tests';
        customObject.nameField = new MetadataService.CustomField();
        customObject.nameField.type_x = 'Text';
        customObject.nameField.label = 'Test Record';
        customObject.deploymentStatus = 'Deployed';
        customObject.sharingModel = 'ReadWrite';
        List<MetadataService.SaveResult> results =
            service.createMetadata(
                new MetadataService.Metadata[] { customObject });
        handleSaveResults(results[0]);

I have executed the above code and I got the error:  I am getting the error because I don't have Createservice() method in my metadataservice class. Can anyone help me how to fix this?
We want to write a trigger that will autmaticallty set the PublishStatus field on a File to be "Public".  But this field not not seem writable in the code.  Any ideas?