• Lauren_H
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 9
    Replies
We need to be able to limit the amount of time that field history records data for. On the lead object, we would like to track history for 6 months and then the data is removed. We don't have development staff, but I can write a bit of apex. Can anyone let me know if they think we can accomplish this with code? Thanks so much! Lauren
I have a situation where I believe I need to run a trigger on a child object to update a parent object field. I have a child object Proposal_Standard_Option that has a checkbox field Is_Optional__c. If the is optional field is checked, I need the same field (same field type and field name) to also be checked on the parent object, Proposal_Line_Item. Does anyone have an idea how this can be done?

I have a trigger that updates opportunity amount based on a field from a custom object (Proposal). I need to modify this trigger to only perform this field update if custom field Apttus_Proposal__Primary__c (checkbox) is checked. Can someone please help me with where in this trigger I need to define this? 

 

Trigger updteopp_Amount on Apttus_Proposal__Proposal__c (after update, after insert) {

Map<id,Decimal> varmap=new Map<id,Decimal>();

List<Opportunity> opp=new List<Opportunity>();

if(Trigger.isupdate){

for(Apttus_Proposal__Proposal__c App:Trigger.New){

if(Trigger.NewMap.get(App.id).Total_Quote_Amount_2__c!=null ){

varmap.put(App.Apttus_Proposal__Opportunity__c,App.Total_Quote_Amount_2__c); //Apttus_Proposal__Opportunity__c put ur lookup which is onto opportunity

}

}

if(!varmap.IsEMpty()){

List<Opportunity> opps=[select id,name,Amount from opportunity where id in:Varmap.keyset()];

if(!opps.isEmpty()){

for(Opportunity o:opps){

o.Amount=varmap.get(o.id);

opp.add(o);

}

database.update(opp);

}

}

}

}

I have a custom object Apttus_Proposal__Proposal__c with a custom field Total_Quote_Amount_2__c. I need Opportunity amount to be updated with the value from Total_Quote_Amount_2__c after update, after insert.  I tried using a workflow field update, but it isn't working. Any help with a trigger to update the opportunity amount value would be extremely appreciated. 

 

As a side note, can anyone tell me which salesforce training class is best for writing triggers?

 

Thank you,

 

Lauren

This trigger I would think would be really easy, but I'm struggling, and new to triggers. How would I write a trigger to set the standard price book on every opportunity? 

I have seen a couple of these posts, but I'm still confused how to get my trigger to work. Here is my error:

 
OnPropLIUpdateIICopyFormulaValueToManual: execution of AfterInsert caused by: System.FinalException: Record is read-only Trigger.OnPropLIUpdateIICopyFormulaValueToManual: line 7, column 1
 
This is my trigger... any ideas??
 
trigger OnPropLIUpdateCopyFormulaValueToManual on Apttus_Proposal__Proposal_Line_Item__c (after update, after insert) {

 if (trigger.new.size()<>1) 
    return;
    //decimal installationTechServicesTotal = 0;
            if (trigger.new[0].Installation_Technical_Services__c != trigger.new[0].Installation_Tech_Ser_Formula__c){
              trigger.new[0].Installation_Technical_Services__c = trigger.new[0].Installation_Tech_Ser_Formula__c;
            }
    
}

I have seen a couple of these posts, but I'm still confused how to get my trigger to work. Here is my error:

 
OnPropLIUpdateIICopyFormulaValueToManual: execution of AfterInsert caused by: System.FinalException: Record is read-only Trigger.OnPropLIUpdateIICopyFormulaValueToManual: line 7, column 1
 
This is my trigger... any ideas??
 
trigger OnPropLIUpdateCopyFormulaValueToManual on Apttus_Proposal__Proposal_Line_Item__c (after update, after insert) {

 if (trigger.new.size()<>1) 
    return;
    //decimal installationTechServicesTotal = 0;
            if (trigger.new[0].Installation_Technical_Services__c != trigger.new[0].Installation_Tech_Ser_Formula__c){
              trigger.new[0].Installation_Technical_Services__c = trigger.new[0].Installation_Tech_Ser_Formula__c;
            }
    
}
I have a situation where I believe I need to run a trigger on a child object to update a parent object field. I have a child object Proposal_Standard_Option that has a checkbox field Is_Optional__c. If the is optional field is checked, I need the same field (same field type and field name) to also be checked on the parent object, Proposal_Line_Item. Does anyone have an idea how this can be done?

I have a trigger that updates opportunity amount based on a field from a custom object (Proposal). I need to modify this trigger to only perform this field update if custom field Apttus_Proposal__Primary__c (checkbox) is checked. Can someone please help me with where in this trigger I need to define this? 

 

Trigger updteopp_Amount on Apttus_Proposal__Proposal__c (after update, after insert) {

Map<id,Decimal> varmap=new Map<id,Decimal>();

List<Opportunity> opp=new List<Opportunity>();

if(Trigger.isupdate){

for(Apttus_Proposal__Proposal__c App:Trigger.New){

if(Trigger.NewMap.get(App.id).Total_Quote_Amount_2__c!=null ){

varmap.put(App.Apttus_Proposal__Opportunity__c,App.Total_Quote_Amount_2__c); //Apttus_Proposal__Opportunity__c put ur lookup which is onto opportunity

}

}

if(!varmap.IsEMpty()){

List<Opportunity> opps=[select id,name,Amount from opportunity where id in:Varmap.keyset()];

if(!opps.isEmpty()){

for(Opportunity o:opps){

o.Amount=varmap.get(o.id);

opp.add(o);

}

database.update(opp);

}

}

}

}

I have a custom object Apttus_Proposal__Proposal__c with a custom field Total_Quote_Amount_2__c. I need Opportunity amount to be updated with the value from Total_Quote_Amount_2__c after update, after insert.  I tried using a workflow field update, but it isn't working. Any help with a trigger to update the opportunity amount value would be extremely appreciated. 

 

As a side note, can anyone tell me which salesforce training class is best for writing triggers?

 

Thank you,

 

Lauren

This trigger I would think would be really easy, but I'm struggling, and new to triggers. How would I write a trigger to set the standard price book on every opportunity? 

I have seen a couple of these posts, but I'm still confused how to get my trigger to work. Here is my error:

 
OnPropLIUpdateIICopyFormulaValueToManual: execution of AfterInsert caused by: System.FinalException: Record is read-only Trigger.OnPropLIUpdateIICopyFormulaValueToManual: line 7, column 1
 
This is my trigger... any ideas??
 
trigger OnPropLIUpdateCopyFormulaValueToManual on Apttus_Proposal__Proposal_Line_Item__c (after update, after insert) {

 if (trigger.new.size()<>1) 
    return;
    //decimal installationTechServicesTotal = 0;
            if (trigger.new[0].Installation_Technical_Services__c != trigger.new[0].Installation_Tech_Ser_Formula__c){
              trigger.new[0].Installation_Technical_Services__c = trigger.new[0].Installation_Tech_Ser_Formula__c;
            }
    
}

I have seen a couple of these posts, but I'm still confused how to get my trigger to work. Here is my error:

 
OnPropLIUpdateIICopyFormulaValueToManual: execution of AfterInsert caused by: System.FinalException: Record is read-only Trigger.OnPropLIUpdateIICopyFormulaValueToManual: line 7, column 1
 
This is my trigger... any ideas??
 
trigger OnPropLIUpdateCopyFormulaValueToManual on Apttus_Proposal__Proposal_Line_Item__c (after update, after insert) {

 if (trigger.new.size()<>1) 
    return;
    //decimal installationTechServicesTotal = 0;
            if (trigger.new[0].Installation_Technical_Services__c != trigger.new[0].Installation_Tech_Ser_Formula__c){
              trigger.new[0].Installation_Technical_Services__c = trigger.new[0].Installation_Tech_Ser_Formula__c;
            }
    
}