Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trigger UpdateQLIs on Quote (before update) {
- list<id> qids=new list<id>();
- for(Quote q:trigger.new)
- {
- Quote OldObj=trigger.OldMap.get(q.id);
- if(q.Total_Number_of_System_Groups__c != oldobj.Total_Number_of_System_Groups__c)
- qids.add(q.id);
- }
- System.debug('quote ids '+qids);
- list<QuoteLineItem> qlis=[select id, quoteID from QuoteLineItem where quoteID in: qids];
- System.debug('qlis '+qlis);
- for(quote q:trigger.new)
- {
- for(quoteLineItem qli:qlis)
- {
- if(qli.quoteID==q.id)
- {
- qli.Markup_Percent__c=q.Total_Number_of_System_Groups__c;
- update qli;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement