• lukas.wallisch1.3903815994810598E12
  • NEWBIE
  • 20 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
Hi All,

we want to know how many days it takes from visiting the customer until the opportunity is closed.

We use events only for these visits, so every account only has one event. What I need to do is to copy the date of this event either to an opportunity or account to add another custom field to calculate the days between start date (I already cloned this field in the event to use it in formulas) and close date.
Another problem is, that CloseDate is only Date and not DateTime like my cloned StartDate. Any chance to calculate it anyway?

Thanks very much for your help!

Lukas
Hello,

I am about to deploy my first trigger to production. When I ran a test in the sandbox I got 100% code coverage, in production I got failed assertion unfortunately.

Here's my trigger for cloning the StartDateTime field from the event to a custom field to use it to calculate days with it:

trigger Eventdate on Event (before insert, before update) {
    for(Event e : trigger.new){
        // write custom field "Start Date/Time"
        e.Start_Date_Time__c = e.StartDateTime;
    }
}


My test class looks like this:

@isTest
// test for the 'Eventdate' triggers
private class Eventdate {
    static testMethod void test() {
        // create dummy Event
        Event e = new Event(ActivityDateTime=Date.Today(), Description='Test Event',
                            DurationInMinutes=10, Subject='Test Event', z_Thema__c='privat');

        insert e;

        // get the custom "Start Date/Time" field values
        DateTime dtmStart_e = [SELECT Start_Date_Time__c FROM Event WHERE
                               Id = :e.Id LIMIT 1].Start_Date_Time__c;

        // test "Start Date/Time"
        System.assert(dtmStart_e == e.StartDateTime);
    }
}


Failure Message: "System.AssertException: Assertion Failed", Failure Stack Trace: "Class.Eventdate.test: line 16, column 1"


I really have no clue what I'm doing wrong so I'm looking forward to any help.

Thank you!
Hi All,

we want to know how many days it takes from visiting the customer until the opportunity is closed.

We use events only for these visits, so every account only has one event. What I need to do is to copy the date of this event either to an opportunity or account to add another custom field to calculate the days between start date (I already cloned this field in the event to use it in formulas) and close date.
Another problem is, that CloseDate is only Date and not DateTime like my cloned StartDate. Any chance to calculate it anyway?

Thanks very much for your help!

Lukas
Hi All,

we want to know how many days it takes from visiting the customer until the opportunity is closed.

We use events only for these visits, so every account only has one event. What I need to do is to copy the date of this event either to an opportunity or account to add another custom field to calculate the days between start date (I already cloned this field in the event to use it in formulas) and close date.
Another problem is, that CloseDate is only Date and not DateTime like my cloned StartDate. Any chance to calculate it anyway?

Thanks very much for your help!

Lukas
Hello,

I am about to deploy my first trigger to production. When I ran a test in the sandbox I got 100% code coverage, in production I got failed assertion unfortunately.

Here's my trigger for cloning the StartDateTime field from the event to a custom field to use it to calculate days with it:

trigger Eventdate on Event (before insert, before update) {
    for(Event e : trigger.new){
        // write custom field "Start Date/Time"
        e.Start_Date_Time__c = e.StartDateTime;
    }
}


My test class looks like this:

@isTest
// test for the 'Eventdate' triggers
private class Eventdate {
    static testMethod void test() {
        // create dummy Event
        Event e = new Event(ActivityDateTime=Date.Today(), Description='Test Event',
                            DurationInMinutes=10, Subject='Test Event', z_Thema__c='privat');

        insert e;

        // get the custom "Start Date/Time" field values
        DateTime dtmStart_e = [SELECT Start_Date_Time__c FROM Event WHERE
                               Id = :e.Id LIMIT 1].Start_Date_Time__c;

        // test "Start Date/Time"
        System.assert(dtmStart_e == e.StartDateTime);
    }
}


Failure Message: "System.AssertException: Assertion Failed", Failure Stack Trace: "Class.Eventdate.test: line 16, column 1"


I really have no clue what I'm doing wrong so I'm looking forward to any help.

Thank you!

Hi All,

 

While Sending an email to the salesforce.We got the following error.Does anybody has any idea what could cause the below given error.

 

This message was created automatically by the mail system.

A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:

>>> emailtosalesforce@jdm6g0a8jnln9wgahzdjsbwj.8dea8eae.c.le.salesforce.
>>> com (Undelivered): 551 Failed due to: SenderAuthorization