• Noob001
  • NEWBIE
  • 0 Points
  • Member since 2008

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

I tried reseting the Status in the meta.xml file in Eclipse but the system tells that that Inactive is not a valid status for classes.

I am trying to update a field in a parent record (Transaction object) with information from a field in related list records (Transaction Relationship object)
I managed to get this code to work. However it does not update the field in the parent object if one of the related list records is deleted or updated.
Any idea how I could do that?
Thanks!
-----------------------------------------------------------------------------------------------------------------------
public class Transactions {
    public static void TransactionListUpdate (Transaction_Relationship__c[] TraUp){
     for (Transaction_Relationship__c TR : TraUp){
     
     string TraID = TR.Transaction__c;
     string Investor = TR.Type__c;
    If (Investor== 'Buyer / Investor'){
         Transaction__c TRel = [select  Selected_Buyer_Investors__c, Id from Transaction__c where Id =: TraID];
         String CompanyName = [Select Name from Account where Id = : TR.Related_Company__c].Name    ; 
             If (TRel.Selected_Buyer_Investors__c != null){
                TRel.Selected_Buyer_Investors__c = TRel.Selected_Buyer_Investors__c + ', ' + CompanyName;
             }else {
                TRel.Selected_Buyer_Investors__c = CompanyName;
             }
            update TRel;
            
         }
     }
    
    }
    
}

I tried reseting the Status in the meta.xml file in Eclipse but the system tells that that Inactive is not a valid status for classes.

I am trying to update a field in a parent record (Transaction object) with information from a field in related list records (Transaction Relationship object)
I managed to get this code to work. However it does not update the field in the parent object if one of the related list records is deleted or updated.
Any idea how I could do that?
Thanks!
-----------------------------------------------------------------------------------------------------------------------
public class Transactions {
    public static void TransactionListUpdate (Transaction_Relationship__c[] TraUp){
     for (Transaction_Relationship__c TR : TraUp){
     
     string TraID = TR.Transaction__c;
     string Investor = TR.Type__c;
    If (Investor== 'Buyer / Investor'){
         Transaction__c TRel = [select  Selected_Buyer_Investors__c, Id from Transaction__c where Id =: TraID];
         String CompanyName = [Select Name from Account where Id = : TR.Related_Company__c].Name    ; 
             If (TRel.Selected_Buyer_Investors__c != null){
                TRel.Selected_Buyer_Investors__c = TRel.Selected_Buyer_Investors__c + ', ' + CompanyName;
             }else {
                TRel.Selected_Buyer_Investors__c = CompanyName;
             }
            update TRel;
            
         }
     }
    
    }
    
}
Hi ,
 
I am trying to create an update trigger on opportunity. and if any opportunity is updated i wanted to merge all the partners in the given opprotunity in to a new custom field call merge_field.
 

I am new to apex. can anyone tell me how this is possible. and some sample code where i can start with.
 
Thanks,