force.com - Query DB using apex in salesforce -
com , apex triggers
i have 2 objects namely customer_c , order_c trying write trigger delete order entry belonging customer has been made inactive.
basically want trigger on update customer_c table
retrieve entry customer_c active_c( boolean value) has been made false upon update , take customers 'name' , in order_c table , delete 'name'(orders) belonging customer.
below trigger code. when trying save trigger in salesforce. following error:
error: compile error: unexpected token: 'res2' @ line 13 column 19
could please me on this?
trigger newcustomeractive on customer__c(after update) { list<customer__c> res2 = [select name customer__c j j.active__c = false]; list<order__c> res = [select name order__c customer__c = res2]; }
change to
trigger newcustomeractive on customer__c(after update) { list<customer__c> res2 = [select name customer__c j j.active__c = false]; list<order__c> res = [select name order__c customer__c in:res2]; }
Comments
Post a Comment