You need to sign in to do that
Don't have an account?
GMASJ
QuoteLines are not getting updated from Quote Trigger
Hi,
I am trying to update quoteline fields from quote using a trigger and helper class it is not getting updated I am not get getting any error please suggest me what is the issue in below code.
Trigger
Sudhir
I am trying to update quoteline fields from quote using a trigger and helper class it is not getting updated I am not get getting any error please suggest me what is the issue in below code.
Trigger
trigger QuoteTrigger on Quote (before insert, Before Update, After Insert) { if(Trigger.isAfter && Trigger.isInsert){ system.debug('After update calling...'); QuoteTriggerUtils.updateQlineDecimals(Trigger.new); } }Helper Class
public static void updateQlineDecimals(List<Quote> qList){ List<id> QtIds = new List<id>(); List<QuoteLineItem> Qtlinlst = new List<QuoteLineItem>(); for(Quote quote:qList){ QtIds.add(quote.id); } List<QuoteLineItem> Qtlines = [select id, Reseller_Discount__c, Disti_Discount__c from QuoteLineItem where quoteid in :QtIds]; for(QuoteLineItem Qtl : Qtlines){ //Qtl.Disti_Discount__c = String.Valueof(Decimal.Valueof(Qtl.Disti_Discount__c).setscale(2)); //Qtl.Reseller_Discount__c = String.Valueof(Decimal.Valueof(Qtl.Reseller_Discount__c).setscale(2)); system.debug('Disti Discount ' + Qtl.Disti_Discount__c); system.debug('Reseller Discount ' + Qtl.Reseller_Discount__c); Qtl.Disti_Discount__c = '1'; Qtl.Reseller_Discount__c = '2'; Qtlinlst.add(Qtl); } update Qtlinlst; }Thanks
Sudhir
I can see that your handler class is only called from after insert operation on Quote. Does the Quote have line items at this point ?
Thanks,
Dmitry
Your trigger is on after insert ,You are quering from Quote LineItem which is th echild object of Quote .At the time of inertion you wil not get any lin e item . Please explain your requirmnet clarly so that we can hlep you .
Thanks
Manoj
Thanks
Sudhir