• Marco Rodriguez
  • 0 Points
  • Member since 2014

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 1
I have a question related to "Customer Community Login" user license.

I created a Community in my Development Edition Org, I have created a Community User assigning it a "Customer Community Login" user license, I logged in to the community with that user a few times, but now when I go to Setup | Company Profile | Company Information, I see that 1 out of 20 "Customer Community Login" licenses have been used. As I understand it, when a Community user is assigned a "Customer Community Login" license, there is a limit on the amount of logins per month, but apparently the information displayed on Company Information is about how many users I can create with that user license.

Does anyone know where in the Org can I see how many total community logins I have for the month and how many have been used up?

Hi, I am getting error as ''System.AssertException: Assertion Failed'. Please help.

Apex Trigger: 

  trigger FirstActivityDate on Task (before insert, before update) {

    List<Id> leadIds=new List<Id>();
    List<Id> ContatcIds=new List<Id>();
    for(Task t:trigger.new){
    // Checking the condition for the trigger to fire 
        if(t.Status=='Completed' && t.Created_by_Role__c == TRUE && (t.whoId != null)){
    //Querying the related Lead and Contact based on whereId on Task
    List<Lead> leadsToUpdate=[SELECT Id, First_Activity_Date__c FROM Lead WHERE Id IN :leadIds AND IsConverted=FALSE AND First_Activity_Date__c=NULL];
    List<Contact> contactToUpdate=[SELECT Id, First_Activity_Date__c FROM Contact WHERE Id IN :ContatcIds AND First_Activity_Date__c=NULL];
     // updating the Lead and contact First Activity Date field
    For (Lead l:leadsToUpdate){
        l.First_Activity_Date__c = date.today();
    For (Contact c:contactToUpdate){
        c.First_Activity_Date__c = date.today();
        update leadsToUpdate;
          update contactToUpdate;
            }catch(DMLException e){
        system.debug('Leads were not all properly updated.  Error: '+e);

Apex Class :

public class FirstActivityDateTest {
    static testMethod void myUnitTest() {
        //Create a test Lead
        Lead ld = new Lead();
            ld.FirstName = 'TestFirstName';
            ld.LastName = 'TestLastName';
            ld.Company = 'TestCompany';
            ld.CountryCode = 'US';
        insert ld;
        //Assert that First_Activity_Date__c = Null
        System.assertEquals(ld.First_Activity_Date__c, null);

        //Create a test user
        list<Profile> p1 = [SELECT Id FROM Profile WHERE Name like 'System Administrator'];
        User u1 = new User();
            u1.FirstName = 'fName';
            u1.LastName = 'lName';
            u1.Email = 'Test1234567@mail.com';
            u1.Username = 'Test1234567@mail.com';
            u1.Alias ='Test123';
            u1.CommunityNickname = 't123';
            u1.TimeZoneSidKey ='America/New_York';
            u1.LocaleSidKey = 'en_US';
            u1.EmailEncodingKey = 'UTF-8';
            u1.ProfileId = p1[0].id;
            u1.LanguageLocaleKey = 'en_US';
            u1.Country = 'United Kingdom';
        insert u1;

        //Create a test Contact
        Contact ct = new Contact();
            ct.FirstName = 'TestFirstName';
            ct.LastName = 'TestLastName';
        insert ct;
       //Assert that First_Activity_Date__c = Null
        System.assertEquals(ct.First_Activity_Date__c, null);

        //Create a test Task
        Task tk = new Task();
            tk.Subject = 'TestSubject';
            tk.ActivityDate = date.today();
            tk.OwnerId = u1.Id;
            tk.Status = 'Completed';
            tk.WhoId = ld.Id;
        insert tk;
         //Create a test Task
        Task t= new Task();
            t.Subject = 'TestSubject';
            t.ActivityDate = date.today();
            t.OwnerId = u1.Id;
            t.Status = 'Completed';
            t.WhoId = ct.Id;
        insert t;

        //Assert that First_Activity_Date__c != null
        ld = [SELECT Id, First_Activity_Date__c FROM Lead WHERE Id = :ld.Id limit 1];
        System.assertEquals(ld.First_Activity_Date__c != null);
  • December 22, 2014
  • Like
  • 0