• John Archer2
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
Hello
I have just written first trigger which works in the sandbox but am getting a code coverage error when trying to deploy
I have written a test class which I think tests one hundred per cent of the code but the application is telling me I have 0% coverage
This is despite the apex class test passing.
My trigger is:

trigger Populatecustomeventfields on Event (before update, before insert) {
For (event event :Trigger.new){
event.report_start_date__c=event.StartDatetime;
event.report_end_date__c=event.EndDateTime;
event.report_subject__c=event.Subject;
}
}

This is working correctly in the sandbox
Below is my test class and I am getting the following error:  "The following triggers have 0% code coverage. Each trigger must have at least 1% code coverage." 
 
@isTest
public class TestPopulatecustomeventfields {
    static testMethod void Insertnewevent(){ 
    Event eventToCreate = new Event();
    eventtocreate.Report_start_date__c =Datetime.valueOf ('08-08-2017 22:00:00');
    eventtocreate.Report_end_date__c =Datetime.valueOf ('08-08-2017 22:00:00');
    eventtocreate.Report_subject__c = 'Demo';
    
}
}

 
 
Hello
Does anyone know whether this is possible in Lightning yet.
This functionality is badly needed
I have read that this is possible in a visualforce page, but have never done one of these 
Could someone point me in the direction of some documentation on this
I have a flow which updates an opportunity (namely a subscription) and creates a new opportunity with the correct info in the fields and copies the previous years opportunity line items correctly.
This is all working fine, the flow is included below.
What i need to do now is get this to work on multiple opportunities at the same time.  There is a field (requires renewal) which is marked to true automatically when 60 days from renewal date.
My line of thinking so far is that it needs a fast lookup to find the opportunities using the "requires renewal" field, and then update them using a second loop.
At this point I am struggling, if someone could give me a few pointers would be extremely grateful 

User-added image
In our salesforce application on the accounts and contacts tabs under activity history we have a button "log a call"
When pressed it produces the following page.
You can see there are four record types defined each of which has it's own picklist values.  Conferences is the default value 
initial record type page
After the selection is made we get the page below
If we look at the record type ringed in the top right hand corner it is showing the correct record type
The problem is the scheduled follow up task underneath(ringed in the bottom right corner).  This has gone back to the wrong record type (default conferences).  This subsequently means the picklist values for the follow up task are wrong.
Is there anyway to get the record type for the follow up task the same as the original selection.  I have tried unticking it under define default values of record types and it make no difference 
Any help greatly appreciated as this one driving me mad for days


User-added image
Hello
I have just written first trigger which works in the sandbox but am getting a code coverage error when trying to deploy
I have written a test class which I think tests one hundred per cent of the code but the application is telling me I have 0% coverage
This is despite the apex class test passing.
My trigger is:

trigger Populatecustomeventfields on Event (before update, before insert) {
For (event event :Trigger.new){
event.report_start_date__c=event.StartDatetime;
event.report_end_date__c=event.EndDateTime;
event.report_subject__c=event.Subject;
}
}

This is working correctly in the sandbox
Below is my test class and I am getting the following error:  "The following triggers have 0% code coverage. Each trigger must have at least 1% code coverage." 
 
@isTest
public class TestPopulatecustomeventfields {
    static testMethod void Insertnewevent(){ 
    Event eventToCreate = new Event();
    eventtocreate.Report_start_date__c =Datetime.valueOf ('08-08-2017 22:00:00');
    eventtocreate.Report_end_date__c =Datetime.valueOf ('08-08-2017 22:00:00');
    eventtocreate.Report_subject__c = 'Demo';
    
}
}

 
 
Hello
Does anyone know whether this is possible in Lightning yet.
This functionality is badly needed
I have read that this is possible in a visualforce page, but have never done one of these 
Could someone point me in the direction of some documentation on this
In our salesforce application on the accounts and contacts tabs under activity history we have a button "log a call"
When pressed it produces the following page.
You can see there are four record types defined each of which has it's own picklist values.  Conferences is the default value 
initial record type page
After the selection is made we get the page below
If we look at the record type ringed in the top right hand corner it is showing the correct record type
The problem is the scheduled follow up task underneath(ringed in the bottom right corner).  This has gone back to the wrong record type (default conferences).  This subsequently means the picklist values for the follow up task are wrong.
Is there anyway to get the record type for the follow up task the same as the original selection.  I have tried unticking it under define default values of record types and it make no difference 
Any help greatly appreciated as this one driving me mad for days


User-added image