• cmoynihan
  • NEWBIE
  • 50 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 10
    Replies

I have a before trigger running on Cases where I am checking a few fields for changes, and notifying the Case Contact owner via email.

 

I am using trigger.new and grabbing the LastModifiedById from the record, but it seems to be the previous person who made the update (the old record value) not the person who just made the update (the new record value).

 

Is that field updated after the record is committed? And if so, how can I find out who made the changes to the record so I can include it in my notification? 

I am getting an error with the line "mail.setToAddresses" in the following code:

 

String email = '';
String ownerName = '';
// Check if Owner is a User if (ownerType == 'User'){ User owner = [select Name, Email from User where Id = :c.OwnerId]; email = owner.Email; ownerName = owner.Name; System.debug('Email: ' + email + ', Name: ' + ownerName); String[] toAddresses = new String[]{email}; mail.setToAddresses(toAddresses); ...

 The debug message is outputting the Email (and Name) just fine, so I am not sure what the problem is. I use the same syntax is another method and it works just fine, so I'm really not sure what the issue is. Any ideas?

I am testing a trigger I wrote for Case Comment notifications, and I want to be able to see my debug messages when a Self Service Portal User enters a comment.

 

How do I go about viewing these? They don't show up in the debug logs, but I am guessing that is because the SSP User is the one setting off the trigger, ont any of the internal users.

I have had the audit fields (created by, created dates, last modified by, etc) opened by sfdc, and need to see if there is a way to populate these via an update rather than an insert. Through the data loader, they are only available via insert. Is this a data loader limitation or a salesforce limitation? We also have DB Amp, and do not have access on an update either. Anyway around this?

I want to be able to call an Apex commandlink action from Javascript. Can I do that?

 

Here is what I have:

 

<apex:commandlink action="{!register}" styleClass="button" id="regSubmit">Register</apex:commandlink>

 And I would like to be able to do something like this in JS:

/* Link in page */
<a href="#" class="button" id="regSubmit">Register</a> </div>


/* JS code */
$("#regSubmit").click(function() {
   var validated = myValidator.data("validator").checkValidity();
   if (validated) {
      /* Do the commandlink action here */
   }
});

 Anyone have any ideas? Thanks.