• LuLu(non-developer)
  • NEWBIE
  • 20 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 12
    Replies
Hi All - I was so excited I was able to create this very "simple" trigger (so new to this) and when I went to deploy it to Prod I received a 0% Code Coverage error. Could someone please help me understand this code coverage madness and what I actually need to do? Is it an Apex Class? I'm so lost...any help is much appreciated, my trigger below for reference.

trigger AttachmentCount on Attachment (after insert)
{

List<lead> co = [select id, Attachment_Added__c from lead where id =:
Trigger.New[0].ParentId];
if(co.size()>0)
{
co[0].Attachment_Added__c = True;
update co;
}
}
I need to create a table like the one below & place it on our lead page layout.
 
 JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC
Usage            
Cost            

I thought perhaps a visualforce page would be the answer so I created a 'usage' and 'cost' fields for each month like the ones below:
Jan_u__c
Jan_c__c
Feb_u__c
Feb_c__c

But I don't know how to set it up as a vf page. If anyone has any feedback or sample code that can get me started that would be much appreciated.
 
Hi All - I was so excited I was able to create this very "simple" trigger (so new to this) and when I went to deploy it to Prod I received a 0% Code Coverage error. Could someone please help me understand this code coverage madness and what I actually need to do? Is it an Apex Class? I'm so lost...any help is much appreciated, my trigger below for reference.

trigger AttachmentCount on Attachment (after insert)
{

List<lead> co = [select id, Attachment_Added__c from lead where id =:
Trigger.New[0].ParentId];
if(co.size()>0)
{
co[0].Attachment_Added__c = True;
update co;
}
}
I need to create a table like the one below & place it on our lead page layout.
 
 JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC
Usage            
Cost            

I thought perhaps a visualforce page would be the answer so I created a 'usage' and 'cost' fields for each month like the ones below:
Jan_u__c
Jan_c__c
Feb_u__c
Feb_c__c

But I don't know how to set it up as a vf page. If anyone has any feedback or sample code that can get me started that would be much appreciated.