• Iqbal Hossain
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 0
    Replies
Hi,
I am not so familiar with Salesforce1 platform. Recently I worked with WebRTC JavaScript library and included it into my visualforce page. It work in desktop browser. But when the same page was viewed in Salesforce1 it does not work. After few googling I found Salesforce1 container does not support WebRTC.

Does canvas can eliminate the limitation of webrtc issue in salesforce1? Is there any other techonology that enable webrtc in salesforce1 container? Please suggest me.
Hi, I could not Apex test coverage to 100%. At loop nested IF was uncovered. The total coverage is 92%.

Apex Class:
 
public class Income{
    private String employeeSortOrder;
    public String currentUserId{get;set;}
    public User currentUser{get;set;}
    
    public Income() {
        currentUserId =  UserInfo.getUserId();
        currentUser = Database.query('SELECT id, Name, EmployeeNumber From User Where id=:currentUserId');
        this.employeeSortOrder = 'Name ASC';  
    }
    
    public List<Employee__c> getEmployees(){
       List<Employee__c> employees = Database.query(
           'SELECT Name, Alias__c, EmployeeCode__c, Department__c, Status__c ' +
            'FROM Employee__c ' +
            'ORDER BY ' + employeeSortOrder);
       
       for (Integer i = 0; i< employees.size(); i++){
           //Next 2 lines was not covered!
           if(currentUser.EmployeeNumber==employees[i].EmployeeCode__c) {
               employees.remove(i);
           }
        }     
            
       return employees;
    }
    
    //Sort by employee code
    public void sortByEmployeeCode() {
        if(employeeSortOrder == 'EmployeeCode__c ASC') {
            this.employeeSortOrder = 'EmployeeCode__c DESC';
        }
        else {
            this.employeeSortOrder = 'EmployeeCode__c ASC';
        }
       
    }
    
    //Sort by department
    public void sortByEmployeeDepartment() {
        if(employeeSortOrder == 'Department__c ASC') {
            this.employeeSortOrder = 'Department__c DESC';
        }
        else {
            this.employeeSortOrder = 'Department__c ASC';
        }
    }
    
    //Sort by status
    public void sortByEmployeeStatus() {
        if(employeeSortOrder == 'Status__c ASC') {
            this.employeeSortOrder = 'Status__c DESC';
        }
        else {
            this.employeeSortOrder = 'Status__c ASC';
        }
    }  
}

Test Class:
@isTest
public class incom_test{

    static testmethod void incom_test(){
        Income i = new Income();
        String result = i.currentUserId;
        User resultUser = i.currentUser;
          
        i.sortByEmployeeCode(); //Ascending
        i.sortByEmployeeCode(); //Descending       
        i.sortByEmployeeDepartment(); //Ascending
        i.sortByEmployeeDepartment(); //Descending
        i.sortByEmployeeStatus(); //Ascending
        i.sortByEmployeeStatus(); //Descending
    }
    
    static testmethod void incom_get_employee_test(){
        Income i = new Income();
        User u = i.currentUser;
        u.EmployeeNumber = '003';
        List<Employee__c> e = i.getEmployees();
        System.assertEquals(9,e.size());      
    }

}



Please help me how can I complete it to 100%?
For an example I have a custom object "Request__c". I have a web service also which insert/update record into Request__c object when some request appears. So as a user I want to get a pop-up window notification periodically or in log in time regarding the information inserted into Request__c object.

It is noted that I would like to show my custom fields in pop-up window.

Is it possible in Salesforce. Looking help.. User-added image