You need to sign in to do that
Don't have an account?

help writing this trigger
I've to write a trigger on "Line_Item__c" object and
field are: Name(Text), Unit Price(Currency), Unit Sold(number), Total Price(Formula:unit_price_c*Unit_sold__c),
Invoice Statement(Master-Detail:Invoice_Statement__c)
Second Object is "Invoice_Statement__c"
and fields are: Name(AutoNumber), Invoice Value(Roll-up summary:Sum of Total_Price__c field of Line_Item__c),
Account__c(Look-up field: Account)
Third Object is "Account"
and fields are: Name(Text), Account_Balance__c(Currency)
Now i have to write trigger on "Line_item__c" object to insert total price into Account_Balance__c field of Account.
Please help me if anyone know how to do this.
Do you want to write trigger on insert of Line_Item__c only? or update as well? Is there any condition to be checked before inserting total price or blindly insert into Account_Balance__c?
on update also and no condition is there.
@Nitin,
I have written a rough code for only insert case. Please do accordingly for an update case.
What will come here in (typecast based on data type). I'm new in salesforce so please tell me how to write it.
Use data type of Account_Balance__c in (). like (Currency)