• Jose Mario Rodriguez
  • NEWBIE
  • 45 Points
  • Member since 2016

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
Team, 

Pretty new to the development side of things and need help on the following class. It a class with a visualforce page (Button) that adds attachements to the notes and attachements section and refreshes to the parent page when ckick save. 

For some reason the test class is not running my class and achieving any code coverage. 

Appreciate any help. 

Below is the test class: 
public class attachmentsample {

    public attachmentsample(ApexPages.StandardController controller) {

    }
    Public Attachment myfile;
    Public Attachment getmyfile()
    {
        myfile = new Attachment();
        return myfile;
    }
   
    Public Pagereference Save()
    {
        String accid = System.currentPagereference().getParameters().get('id');

        Attachment a = new Attachment(parentId = accid, name=myfile.name, body = myfile.body);
         
         /* insert the attachment */
         insert a;
        return NULL;
    }   

}

Test class:
@isTest
public class Test2attachmentsample {
  private static testMethod void attachmentsampletest() {


    Tenant_Coordination__C TC = new Tenant_Coordination__C(Name ='Test');
    insert TC; 
    
     Attachment attach=new Attachment();    
     attach.Name='Unit Test Attachment';
     Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body');
     attach.body=bodyBlob;
     attach.parentId=TC.id;
     insert attach;

     List<Attachment> attachments=[select id, name from Attachment where parent.id=: TC.Id];
     System.assertEquals(1, attachments.size());
    }
}

 
I'm using email services for the integration of Office 365 and create Task with their Contact and Lead, I have been able to create task and assign them to the appropiate contact and lead, but for the next stage, when the contact not exist would create Tasks in the section on My Unresolved Items, can i create a Task and send it to the section of My Unresolved Items by apex code?

I read these documents but does not speak anything about Task from code apex.

http://help.salesforce.com/apex/HTViewHelpDoc?id=outlookcrm_unresolved_items.htm
 

I am using email services for the integration of Office 365 and generate tasks with their contact and prospect, I have been able to create tasks and assign them to the appropriate contact, but for the next stage, when the contact does not exist would create Tasks in the section on unresolved items, can I create a Task and send it to the section of unresolved items by apex code?

I read these documents but does not speak anything about Tasks from code apex

http://help.salesforce.com/apex/HTViewHelpDoc?id=outlookcrm_unresolved_items.htm

Team, 

Pretty new to the development side of things and need help on the following class. It a class with a visualforce page (Button) that adds attachements to the notes and attachements section and refreshes to the parent page when ckick save. 

For some reason the test class is not running my class and achieving any code coverage. 

Appreciate any help. 

Below is the test class: 
public class attachmentsample {

    public attachmentsample(ApexPages.StandardController controller) {

    }
    Public Attachment myfile;
    Public Attachment getmyfile()
    {
        myfile = new Attachment();
        return myfile;
    }
   
    Public Pagereference Save()
    {
        String accid = System.currentPagereference().getParameters().get('id');

        Attachment a = new Attachment(parentId = accid, name=myfile.name, body = myfile.body);
         
         /* insert the attachment */
         insert a;
        return NULL;
    }   

}

Test class:
@isTest
public class Test2attachmentsample {
  private static testMethod void attachmentsampletest() {


    Tenant_Coordination__C TC = new Tenant_Coordination__C(Name ='Test');
    insert TC; 
    
     Attachment attach=new Attachment();    
     attach.Name='Unit Test Attachment';
     Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body');
     attach.body=bodyBlob;
     attach.parentId=TC.id;
     insert attach;

     List<Attachment> attachments=[select id, name from Attachment where parent.id=: TC.Id];
     System.assertEquals(1, attachments.size());
    }
}

 
I'm using email services for the integration of Office 365 and create Task with their Contact and Lead, I have been able to create task and assign them to the appropiate contact and lead, but for the next stage, when the contact not exist would create Tasks in the section on My Unresolved Items, can i create a Task and send it to the section of My Unresolved Items by apex code?

I read these documents but does not speak anything about Task from code apex.

http://help.salesforce.com/apex/HTViewHelpDoc?id=outlookcrm_unresolved_items.htm
 
Hi,

In my org there is an already installed managed package with the object 'ABC' and there is one profile 'XYZ' with 'High Volume Customer Portal' as User License.

Now,
I have created a VF page wherein I am accessing a field of Object ABC. But unfortunately it is not visible on my VF page when I see it via user of XYZ profile.
For resolving when I looked into the profile I found that this particular Object is not present in "Custom Object Premission" (while it is visible in other custom profiles which have user license salesforce etc.).

Any idea how can I make this custom object visible on my profile and henceforth on my VF page.


Thanks!
Regards,
Ritik
  • August 12, 2015
  • Like
  • 0