• sfdc_apex_learner
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Hello All,

 

I need some help with a case trigger. Here's my setup and what I am trying to do:

 

I have a Case email field called Designated Email Address (from Account) - it's API Name is Designated_Email_Address_from_Account__c. I also have an Account email field called Designated Email Address - API Name is Designated_Email_Address__c. On the Case detail page, I have the standard Account Name field which is a lookup on the Account object.

 

What I want done via a trigger is when I update the Account Name field on the Case by the lookup, that it will also populate the Designated_Email_Address_from_Account__c on the Case based on the Designated_Email_Address__c from the Account.

 

Please post the code to make this happen along with code comments as I would like to learn how you came up with the code.

 

Thanks!

 

 

 

 

 

Hello,
 
 
Note: Starting with Spring ’12, the Self-Service portal isn’t available for new organizations. Existing organizations continue to have access to the Self-Service portal.
 
My questions are:
 
1) For customers who are currently using the Self-Service portal, how do they migrate to the Customer Portal? Do I need to setup redirect links from the Self-Service portal to the Customer Portal? i.e. What are the steps to migrate both inside and outside of Salesforce?
 
2) Once Self-Service Portal customers migrate to the Customer Portal, do the existing Self-Service Portal users' passwords also get migrated? Or will the users need to sign up again?
 
Thanks!

Hello All,

 

This is my first attempt at writing an apex trigger. I got the code from another post on this board at http://boards.developerforce.com/t5/Apex-Code-Development/Trigger-Update-Lookup-Field/m-p/354509/highlight/true#M62906

 

I am trying to update the Store__c field on the standard Case object. This Store__c field is a lookup to a custom object called Store.

 

Below is my code. Any ideas?

 

trigger UpdateStoreName on Case (before update, before insert) {
List<String> StoreNames = new List<String>();
for (Case a: Trigger.new)
{
StoreNames.add(a.Store__c);
}
List <Store__c> StoreNameList = [Select Id from Store__c where Name in :StoreNames];
for (integer i = 0; i < Trigger.new.size(); i++)
{
if(Trigger.new[i].Store__c != null)
{
Trigger.new[i].Store__c = StoreNameList[i].ID;
}
else
{
Trigger.new[i].Store__c = null;
}
}
}

Hello All,

 

I need some help with a case trigger. Here's my setup and what I am trying to do:

 

I have a Case email field called Designated Email Address (from Account) - it's API Name is Designated_Email_Address_from_Account__c. I also have an Account email field called Designated Email Address - API Name is Designated_Email_Address__c. On the Case detail page, I have the standard Account Name field which is a lookup on the Account object.

 

What I want done via a trigger is when I update the Account Name field on the Case by the lookup, that it will also populate the Designated_Email_Address_from_Account__c on the Case based on the Designated_Email_Address__c from the Account.

 

Please post the code to make this happen along with code comments as I would like to learn how you came up with the code.

 

Thanks!

 

 

 

 

 

Hello All,

 

This is my first attempt at writing an apex trigger. I got the code from another post on this board at http://boards.developerforce.com/t5/Apex-Code-Development/Trigger-Update-Lookup-Field/m-p/354509/highlight/true#M62906

 

I am trying to update the Store__c field on the standard Case object. This Store__c field is a lookup to a custom object called Store.

 

Below is my code. Any ideas?

 

trigger UpdateStoreName on Case (before update, before insert) {
List<String> StoreNames = new List<String>();
for (Case a: Trigger.new)
{
StoreNames.add(a.Store__c);
}
List <Store__c> StoreNameList = [Select Id from Store__c where Name in :StoreNames];
for (integer i = 0; i < Trigger.new.size(); i++)
{
if(Trigger.new[i].Store__c != null)
{
Trigger.new[i].Store__c = StoreNameList[i].ID;
}
else
{
Trigger.new[i].Store__c = null;
}
}
}