• RiPaul
  • NEWBIE
  • 25 Points
  • Member since 2010

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 11
    Replies

Hi,

 

Is it possible to fire an Apex trigger on a Task sObj when a user clicks the Edit button?   I'd like to be able to have a trigger automatically put the date (System.today()) in The Task's Description field.   Right now my trigger event is defined as "before insert", but this won't update the Task.Description field until after the Task Save button is clicked.   That's too late :)

 

Any ideas??   Thanks as always for your collective support.

 

Best regards,

-P 

  • August 31, 2010
  • Like
  • 1

Hi folks,

 

How in the world do I test my getters / setters in this class snippet?

 

public with sharing class VFControllerSendEmail {

     

      // Nice explanation on how these property getters and setters actaully work

      // http://blog.sforce.com/sforce/2008/06/property-access.html

      public String email {get {return email;} set {email = email;}}

     

...

...

 

I then have a unit test that does the following in an attempt to test the get/set email prop.

 

...

...

VFControllerSendEmail sendFollowUp = new VFControllerSendEmail(theID);

System.assert(sendFollowUp != null);

sendFollowUp.email = 'sommer@jnbridge.com';

String testEm = sendFollowUp.email;

System.assert(sendFollowUp.email != null);

System.debug('TEST 3 email: ' + testEm);

 

...

...

 

Now, when I run the Apex Test Runner, my Code Coverage Results tell me that the get/set email props are not covered.   More specifically, I get "Line 5, Column 28 not covered".    What?   What I'm I missing??

 

Thanks in advance for any help one of you might be able to extend.

 

Best regards,

Paul

  • August 26, 2010
  • Like
  • 0

Hi guys,

 

I've got a new VF page that is using a customer controller (VF controller extension).   All's well.   The VF page has an autorun event defined as its action that is invoked via a custom button on a Task sObj.  

 

I can run this little "app" from within SF just fine and preview the SF Debug Logs looking for output from my System.debug statements.   However, this is pretty clumsy and I'm thinking there's got to be a better way to run this little VF applet from the Force.com Debug perspective under Eclipse.  

 

Right now all I have in my Eclipse project is my src->pages-> myPage and src->classes->myClass.   Can I add the stock SF Task sObj to my project and somehow run my tests from Eclipse where I can set breakpoints, etc??   Please, there's got to be a way and I'm just missing some area of the documentation that might explain how to set this up.

 

Thanks very much in advance for any direction one of you might be able to extend.

 

Best regards,

Paul 

  • August 09, 2010
  • Like
  • 0

Hello,

 

I have what I think should be a basic question, but I can't seem to readily discover the best route to meet my requirementd.    As background, we work primarily out of the Task object managing prospect and customer follow up communications.   

 

I want to start extending the stock Task object to perform common actions more directly.   For example, I'd like to have a new button (I know how to do this and add to view, etc) called "Final Follow Up".   When this button is pushed, the event should pass the lead or contact name info associated with the Task to a new e-mail obj with my  canned final follow up e-mail template applied.   Here's what my final e-mail template looks like:

 

Hi {!Contact.FirstName},

Some generic final message body. 


Kind regards,
{!User.FirstName}

 

So, the event would invoke a new SF e-mail editor (or just send directly which would be even better) with the communications template of choice applied (in this case final follow up) and the Contact.FirstName would be set by data passed by the Task event (via the URL or something).   I'm not sure if I should plow down the JavaScript or Apex route and therefore, any advice one of you could extend on how to best get started would be tremendously helpful.   Thanks in advance!!

 

-Paul

  • April 14, 2010
  • Like
  • 0

Hi,

 

Is it possible to fire an Apex trigger on a Task sObj when a user clicks the Edit button?   I'd like to be able to have a trigger automatically put the date (System.today()) in The Task's Description field.   Right now my trigger event is defined as "before insert", but this won't update the Task.Description field until after the Task Save button is clicked.   That's too late :)

 

Any ideas??   Thanks as always for your collective support.

 

Best regards,

-P 

  • August 31, 2010
  • Like
  • 1

Hi,

 

Is it possible to fire an Apex trigger on a Task sObj when a user clicks the Edit button?   I'd like to be able to have a trigger automatically put the date (System.today()) in The Task's Description field.   Right now my trigger event is defined as "before insert", but this won't update the Task.Description field until after the Task Save button is clicked.   That's too late :)

 

Any ideas??   Thanks as always for your collective support.

 

Best regards,

-P 

  • August 31, 2010
  • Like
  • 1

Hi folks,

 

How in the world do I test my getters / setters in this class snippet?

 

public with sharing class VFControllerSendEmail {

     

      // Nice explanation on how these property getters and setters actaully work

      // http://blog.sforce.com/sforce/2008/06/property-access.html

      public String email {get {return email;} set {email = email;}}

     

...

...

 

I then have a unit test that does the following in an attempt to test the get/set email prop.

 

...

...

VFControllerSendEmail sendFollowUp = new VFControllerSendEmail(theID);

System.assert(sendFollowUp != null);

sendFollowUp.email = 'sommer@jnbridge.com';

String testEm = sendFollowUp.email;

System.assert(sendFollowUp.email != null);

System.debug('TEST 3 email: ' + testEm);

 

...

...

 

Now, when I run the Apex Test Runner, my Code Coverage Results tell me that the get/set email props are not covered.   More specifically, I get "Line 5, Column 28 not covered".    What?   What I'm I missing??

 

Thanks in advance for any help one of you might be able to extend.

 

Best regards,

Paul

  • August 26, 2010
  • Like
  • 0

Hi guys,

 

I've got a new VF page that is using a customer controller (VF controller extension).   All's well.   The VF page has an autorun event defined as its action that is invoked via a custom button on a Task sObj.  

 

I can run this little "app" from within SF just fine and preview the SF Debug Logs looking for output from my System.debug statements.   However, this is pretty clumsy and I'm thinking there's got to be a better way to run this little VF applet from the Force.com Debug perspective under Eclipse.  

 

Right now all I have in my Eclipse project is my src->pages-> myPage and src->classes->myClass.   Can I add the stock SF Task sObj to my project and somehow run my tests from Eclipse where I can set breakpoints, etc??   Please, there's got to be a way and I'm just missing some area of the documentation that might explain how to set this up.

 

Thanks very much in advance for any direction one of you might be able to extend.

 

Best regards,

Paul 

  • August 09, 2010
  • Like
  • 0

Hello,

 

I have what I think should be a basic question, but I can't seem to readily discover the best route to meet my requirementd.    As background, we work primarily out of the Task object managing prospect and customer follow up communications.   

 

I want to start extending the stock Task object to perform common actions more directly.   For example, I'd like to have a new button (I know how to do this and add to view, etc) called "Final Follow Up".   When this button is pushed, the event should pass the lead or contact name info associated with the Task to a new e-mail obj with my  canned final follow up e-mail template applied.   Here's what my final e-mail template looks like:

 

Hi {!Contact.FirstName},

Some generic final message body. 


Kind regards,
{!User.FirstName}

 

So, the event would invoke a new SF e-mail editor (or just send directly which would be even better) with the communications template of choice applied (in this case final follow up) and the Contact.FirstName would be set by data passed by the Task event (via the URL or something).   I'm not sure if I should plow down the JavaScript or Apex route and therefore, any advice one of you could extend on how to best get started would be tremendously helpful.   Thanks in advance!!

 

-Paul

  • April 14, 2010
  • Like
  • 0