• Sarath R
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
Can someone please help me write a test class for this class

 //This is a Class that updates user email address when changed on Contact Object
public class ContactTriggerClass {
    string text1='New Reviewer';
    public contactTriggerClass(){}
    //This is the method where it checks if both contact email and user email are same and updates accordingly
    public void changeuseremailfromContact(Contact c)
    {
       Contact cnt=[select email from Contact where id=:c.Id];//This gives Emailid and Email of that Contact where trigger is fired
    system.debug(cnt);
    string emailid=string.valueof(cnt.Email);//getting only email Id
    system.debug('The Email id is:' + emailid);
    
    User usr=[select Email,Username from User where ContactId=:c.Id];//contact
    system.debug(usr);
    system.debug('The contact Email is' + cnt.Email);
    system.debug('The new email is :' + c.Email);
    if(c.Email!=usr.email)//if both emails are different then update user with new
         {
        usr.Email=c.Email;
        system.debug('The new User Email is' + usr.Email );
        database.update(usr);
        System.debug('The updated user is' + usr);
        }
    }
    
    //This is a method based on contact reviewer status changing the profile of the user automatically
    
    public void updateuserprofile(contact ct)
    {
         User u=[select Id,Email,Username from User where contactid=:ct.id];
    system.debug(u);
    if(ct.Reviewer_Status__c.equals(text1))
    {
         updateuserinformation.updateuser(u.id);
    }     
        
    }

}
I want to create a button that will display the 'Industry' field in my leads and allow me to update that field.

I've created a text field but not sure how to display the industry field here and update it. 

Can anyone help??
Hi

I need help in writing a javascript code for a button ( 'on click action' ) that should display a picklist field and allow me to update the record based on the piclikst. ( like changing the industry in the lead tab )
hi all,

I urgently need to edit/delete a post made by me on this discussion forum...But its not allowing me to do so and pops up
saying that 'you cant delete this question as others are interested in it'.
There are no likes and no comments on it still i am unable  to delete it
Any help would be highly appreciated

Its very urgent,
Thanks,