• Pal Adu
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
I need the field on Trip Report>Company Overview to be updated on the Display page with the value from Account>Company Overview once a new trip report is saved.


trigger UpdateCompanyOverviewField on Trip_Report__c (after insert,after update) {
    Trip_Report__c trip=trigger.new[0];
            if(trip.Company_Name__c!=null){
                trip.Company_Overview__c = [SELECT Company_Overview__c FROM Account WHERE Name=:trip.Company_Name__c];
                update trip;
            }
}
Error: Compile Error: Illegal assignment from LIST<Account> to String at line 4 column 17

I did try using the Formula field and a field update workflow to implement this but it didn't work because
A. Trip Report>COmpany Name field is a lookup field to Account
B. The Company Overview fields are both Text Area fields.

Any help please
  • September 18, 2014
  • Like
  • 0
I am trying to write a simple trigger for a custom field update(text to text)

trigger UpdateCompanyOverviewField on Trip_Report__c (before insert) {
    for( Trip_Report__c obj: trigger.new){
        if(Company_Name__c=Name){
            Company_Over__c = Company_Overview__c;
        }
    }
}

error: Variable does not exist: Company_Over__c

I am stumpmed as the API name for Company_Over__c checks out. Any help please
  • September 17, 2014
  • Like
  • 0
I need the field on Trip Report>Company Overview to be updated on the Display page with the value from Account>Company Overview once a new trip report is saved.


trigger UpdateCompanyOverviewField on Trip_Report__c (after insert,after update) {
    Trip_Report__c trip=trigger.new[0];
            if(trip.Company_Name__c!=null){
                trip.Company_Overview__c = [SELECT Company_Overview__c FROM Account WHERE Name=:trip.Company_Name__c];
                update trip;
            }
}
Error: Compile Error: Illegal assignment from LIST<Account> to String at line 4 column 17

I did try using the Formula field and a field update workflow to implement this but it didn't work because
A. Trip Report>COmpany Name field is a lookup field to Account
B. The Company Overview fields are both Text Area fields.

Any help please
  • September 18, 2014
  • Like
  • 0
I am trying to write a simple trigger for a custom field update(text to text)

trigger UpdateCompanyOverviewField on Trip_Report__c (before insert) {
    for( Trip_Report__c obj: trigger.new){
        if(Company_Name__c=Name){
            Company_Over__c = Company_Overview__c;
        }
    }
}

error: Variable does not exist: Company_Over__c

I am stumpmed as the API name for Company_Over__c checks out. Any help please
  • September 17, 2014
  • Like
  • 0