• KSTNE
  • NEWBIE
  • 0 Points
  • Member since 2013

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

Hi guys,

 

Here is the scenario. We have two objects, Contacts and Opportunity. Contact has Latitude__c and Longitude__c fields and so does the Opportunity.

 

We want to populate the fields Latitude__c and Longitude__c in Contact as soon as those fields are filled in Opportunity. I guess this is a cross-object field update ?

 

The code below is what I have at the moment, but I'm not sure if I'm doing it right. Any help or ideas are welcome.

 

 

trigger Contact_Update on Opportunity (after insert) {

    try {
        if (trigger.new.size()==1){
        	
           //for(Opportunity O : Trigger.new) {
               Contact cnt = new Contact();
               Opportunity Op = new Opportunity();
               
			   cnt.Longitude__c = Op.longitude__c;
			   cnt.Latitude__c = Op.latitude__c;
			   
			   update cnt;
           //}
        }
    } catch(Exception e) {
        system.debug ('error: ' + e.getMessage() );
    }
    
}

 

Thanks

 

  • September 12, 2013
  • Like
  • 0

Hi,

 

We are working on email templates and we cannot figure out how to do the IF THEN properly. Does Salesforce has an 'OR' operator ?

 

Basically what we have is 3 checkboxes, when one or more is checked we want the code to show "GOOD" when none are checked then show "BAD"

 

The code below is obviously wrong,

 

{!IF((Opportunity.fullcatalog__c==FALSE) OR (Opportunity.custommanudiv__c=FALSE) OR (pportunity.contactme__c=FALSE), "GOOD", "BAD")}

 

We also tried the "CASE" statement, but it did not work.

 

Thanks in advance!

  • September 06, 2013
  • Like
  • 0

Hi,

 

We are adding tabs to our Account, Contact, Lead and Opportunities pages. We have already added custom pages and used the Apex code to create the tabs.

 

However, the problem we are having is when we are trying to add "Activity History", "Open Activities" or any other objects to our custom tabbed page.

 

The error we get looks like this,

 

 
'activityhistory' is not a valid child relationship name for entity Lead 

 

Here is the code that we use to create tabs and add "Activity History",

 

 

 

      <apex:tab label="Lead Detail" name="LeadDetails" id="tabdetails" styleclass="AcctListStyle">
             <apex:detail relatedList="false" title="true"/>
             
             <apex:relatedList subject="{!lead}" list="activityhistory" />             
      </apex:tab>

 

 

If you could please post a step by step process on how to get this resolved, thanks in advance!

 

  • September 05, 2013
  • Like
  • 0

Hi,

 

We are working on email templates and we cannot figure out how to do the IF THEN properly. Does Salesforce has an 'OR' operator ?

 

Basically what we have is 3 checkboxes, when one or more is checked we want the code to show "GOOD" when none are checked then show "BAD"

 

The code below is obviously wrong,

 

{!IF((Opportunity.fullcatalog__c==FALSE) OR (Opportunity.custommanudiv__c=FALSE) OR (pportunity.contactme__c=FALSE), "GOOD", "BAD")}

 

We also tried the "CASE" statement, but it did not work.

 

Thanks in advance!

  • September 06, 2013
  • Like
  • 0

Hi,

 

We are adding tabs to our Account, Contact, Lead and Opportunities pages. We have already added custom pages and used the Apex code to create the tabs.

 

However, the problem we are having is when we are trying to add "Activity History", "Open Activities" or any other objects to our custom tabbed page.

 

The error we get looks like this,

 

 
'activityhistory' is not a valid child relationship name for entity Lead 

 

Here is the code that we use to create tabs and add "Activity History",

 

 

 

      <apex:tab label="Lead Detail" name="LeadDetails" id="tabdetails" styleclass="AcctListStyle">
             <apex:detail relatedList="false" title="true"/>
             
             <apex:relatedList subject="{!lead}" list="activityhistory" />             
      </apex:tab>

 

 

If you could please post a step by step process on how to get this resolved, thanks in advance!

 

  • September 05, 2013
  • Like
  • 0