• Hashwathi Anandan
  • NEWBIE
  • 10 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
How to create LWC Component with one Text box and Seearch button  >>text box
>> search button 
While entering a name in text box it should search for record and return Two fields which is Name and Type of object on the page .
1.Contact has Picklist values of
>>Status = Draft ,Open,Closed 
2.Account has three fields 
>>No.of .Open Contacts
>>No.of.Closed Contacts
>>No .of .Draft contacts 
write a Apex trigger to update the number of draft ,open,closed contacts on Account field  ,based on contact status .
 
Hi all,
I am starting my learning in Apex trigger with test classes ,Here I have  got some errors while creating test class for below code .Please help me out ! .Thanks in advance 
trigger DemoTtrigger1 on Author__c (before insert,before update,before delete) {
    If(trigger.isInsert){
        for(Author__c Author: Trigger.new){
            //Populates Description with the user first name who creates the record
            Author.Description__c = 'Author Created by '+ userInfo.getFirstName(); 
        }
    } else
        If(trigger.isUpdate){
            for(Author__c Author: Trigger.new){
          //Updates Description with the user first name who updates the record
                Author.Description__c = 'Author Last updated by '+ userInfo.getFirstName();   
            }
        }
    if(Trigger.isDelete&&Trigger.isbefore){ 
        for(Author__c Rec:trigger.old) 
        {
          //User gets the below error when user tried to delete the record
            Rec.adderror('You Cannot Delete the Author Record');
        }
    }
}




 
Hi all,
I am starting my learning in Apex trigger with test classes ,Here I have  got some errors while creating test class for below code .Please help me out ! .Thanks in advance 
trigger DemoTtrigger1 on Author__c (before insert,before update,before delete) {
    If(trigger.isInsert){
        for(Author__c Author: Trigger.new){
            //Populates Description with the user first name who creates the record
            Author.Description__c = 'Author Created by '+ userInfo.getFirstName(); 
        }
    } else
        If(trigger.isUpdate){
            for(Author__c Author: Trigger.new){
          //Updates Description with the user first name who updates the record
                Author.Description__c = 'Author Last updated by '+ userInfo.getFirstName();   
            }
        }
    if(Trigger.isDelete&&Trigger.isbefore){ 
        for(Author__c Rec:trigger.old) 
        {
          //User gets the below error when user tried to delete the record
            Rec.adderror('You Cannot Delete the Author Record');
        }
    }
}