• Sara Burch 20
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Google Map Visualforce page to display an opportunity list to see assignment by date for visual route organization? I've been searching and haven't receive confidence that it can be done without solution purchase.
Hello everyone, I successfully create a form of record views of users and now cannot deploy in my production org without a test class. I've searched all day for a sample test that can help explain what I am to do, no luck!

Here is my class code:
 
public class lastViewed{
 
    public Datetime cDT; 
    public String LongDate; 
    public String firstname; 
    public String lastname;    
    public String userid;
 
    private final Chalkboard_Manager__c acct;
 
    public lastViewed(ApexPages.StandardController stdController) {
        this.acct = (Chalkboard_Manager__c)stdController.getRecord();    }
 
                public String getLongDate() {        
                cDT = System.now();        //Format the datetime value to your locale        
                LongDate = cDT.format('dd/MM/yyyy HH:mm');    return LongDate;    
            }
 
        public void updateField() {
        //Get the user info from the current user        
    firstname = System.Userinfo.getFirstName();        
    lastname = System.Userinfo.getLastName();       
    userid = System.Userinfo.getUserId();
 
        //Get the chalkboard record to be updated        
    Chalkboard_Manager__c a = [select Last_Viewed_By__c from Chalkboard_Manager__c where id = :acct.id limit 1];        
 
    //Assign values to Last Viewed By field & update the record        
    a.Last_Viewed_By__c = (firstname + ' ' + lastname + ', ' + getLongDate());        
    update a;    
    }
 
}

 
Hello everyone, I successfully create a form of record views of users and now cannot deploy in my production org without a test class. I've searched all day for a sample test that can help explain what I am to do, no luck!

Here is my class code:
 
public class lastViewed{
 
    public Datetime cDT; 
    public String LongDate; 
    public String firstname; 
    public String lastname;    
    public String userid;
 
    private final Chalkboard_Manager__c acct;
 
    public lastViewed(ApexPages.StandardController stdController) {
        this.acct = (Chalkboard_Manager__c)stdController.getRecord();    }
 
                public String getLongDate() {        
                cDT = System.now();        //Format the datetime value to your locale        
                LongDate = cDT.format('dd/MM/yyyy HH:mm');    return LongDate;    
            }
 
        public void updateField() {
        //Get the user info from the current user        
    firstname = System.Userinfo.getFirstName();        
    lastname = System.Userinfo.getLastName();       
    userid = System.Userinfo.getUserId();
 
        //Get the chalkboard record to be updated        
    Chalkboard_Manager__c a = [select Last_Viewed_By__c from Chalkboard_Manager__c where id = :acct.id limit 1];        
 
    //Assign values to Last Viewed By field & update the record        
    a.Last_Viewed_By__c = (firstname + ' ' + lastname + ', ' + getLongDate());        
    update a;    
    }
 
}