You need to sign in to do that
Don't have an account?
ran67
bulkification of trigger
HI
I had wrote a trigger .it is working fine but now i want to bulkify my trigger...please help me to bulkification.
I am sending thte trigger .
please help me for bulkification.....thanks in advance
Trigger:
----------------------
trigger UpdateTenantAllocation on Tenant_Allocations__c (after update)
{
public list<Invoice_and_Billing_Detail__c> INVBD {get;set;}
INVBD = new List<Invoice_and_Billing_Detail__c>();
for(Tenant_Allocations__c t:trigger.new)
{
Location__c l1=[select id,Bill_Tenants__c from location__c where id=:t.Location_new__c];
system.debug('............'+l1);
Invoice_and_Billing_Detail__c[] lb=[select id,Rate__c, name,Location1__c from Invoice_and_Billing_Detail__c where Location1__c=:l1.id and QB_Txn_ID__c=null ];
system.debug('............'+lb);
for(Invoice_and_Billing_Detail__c lb1:lb){
if(l1.Bill_Tenants__c==true)
{
lb1.Rate__c=t.Next_Period_Invoice_Amount__c;
}
else
{
lb1.Rate__c=222;
}
INVBD.add(lb1);
}
update INVBD;
system.debug('............'+lb);
}
}
strange ..... u wrote a property in trigger...? properties generally used to exchange a value from custom front end to controller... its better first if you go through the apex docs ..
can u give me code for bulkification its an urgent requirement
Use these for the logic inside the loops for the bulkification of the triggers
Please confirm if your issue is solved so that i can mark this as solved