• MrBurnz1980
  • NEWBIE
  • 25 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 10
    Replies

I am trying to write a simple trigger that will update the contact record if a user updates their email address in the customer portal (User record). The code below works but I get a DML exception once the code is Active and a new contact is being enabled to be a customer portal user, exisiting customer portal user record is modified. What am I doing wrong? Thanks.

 

trigger ContactUpdater on User bulk (after update) { 
        Contact a; 
        for (User u : Trigger.new) { 
                String contactId = u.ContactId; 
                if (contactId!=null && contactId!='') { 
                        a = [select Id,Email from Contact where Id=:contactId]; 
                        a.Email = u.Email;       
                        update a; 
                } 
        }
}

 

I am trying to create some shortcuts on the home page and one of the shortcuts should default to Current day to show "My Day"..as in this is what my calendar and tasks for today looks like..I am not sure how to construct the url. Appreciate the help!

 

Here is my code so far..this defaults to Jan 29th 2013..how do I get it to just show the current day? Thanks!!

 

 <td>
            <a href="/00U/c?cType=1&md0=2013&md3=29" target="_top"> <img src="{!$Resource.MyDay}" height="100" width="100" />   </a>
        </td>

 

Hello..writing my first trigger. Could use your help :)

 

I have a custom object Financial__c that is a upload of payment information. I want to share this with Customer Portal users. The sharing is private since each customer can only see their payment. Also the upload has to happen using DataLoader.io which does not allow for OwnerID update. I need to update the OwnerId to the ID of the Customer Portal user so they can see it. As far I as know I can only do this with a trigger. Here is the simple trigger I've started with but getting an error. Appreciate your help!

 

trigger UpdateOwnerRecordBulk on Financial__c (before insert, before update) {

for (Financial__c oPayment : trigger.new) {

oPayment.OwnerID = [Select ID from USER WHERE ContactID=:oPayment.Home_Owner__c];

}

}

 

Error: Illegal assignment from LIST<User> to Id

I am trying to write a simple trigger that will update the contact record if a user updates their email address in the customer portal (User record). The code below works but I get a DML exception once the code is Active and a new contact is being enabled to be a customer portal user, exisiting customer portal user record is modified. What am I doing wrong? Thanks.

 

trigger ContactUpdater on User bulk (after update) { 
        Contact a; 
        for (User u : Trigger.new) { 
                String contactId = u.ContactId; 
                if (contactId!=null && contactId!='') { 
                        a = [select Id,Email from Contact where Id=:contactId]; 
                        a.Email = u.Email;       
                        update a; 
                } 
        }
}

 

Hello..writing my first trigger. Could use your help :)

 

I have a custom object Financial__c that is a upload of payment information. I want to share this with Customer Portal users. The sharing is private since each customer can only see their payment. Also the upload has to happen using DataLoader.io which does not allow for OwnerID update. I need to update the OwnerId to the ID of the Customer Portal user so they can see it. As far I as know I can only do this with a trigger. Here is the simple trigger I've started with but getting an error. Appreciate your help!

 

trigger UpdateOwnerRecordBulk on Financial__c (before insert, before update) {

for (Financial__c oPayment : trigger.new) {

oPayment.OwnerID = [Select ID from USER WHERE ContactID=:oPayment.Home_Owner__c];

}

}

 

Error: Illegal assignment from LIST<User> to Id