You need to sign in to do that
Don't have an account?
harish reddy 50
How make check box ticked using trigger..?
Hi,
I have two objects one is standard object(contact) and coustom(Payment__c) and thay have lookup from Payment to contacts .My requirement when ever payment record is created corresponding confirmpaymnt checkbox on contact should be tickked.
I have tried trigger but functionality not working can any one help me with this.
Thanks in Advance.
TRIGGER:
rigger checkboTrigger on Payment__c(after Insert) {
List<id> ids = new List<id>();
List<contact> conn3 = new List<contact>();
for(Payment__c pay: Trigger.new)
{
ids.add(pay.id);
}
List<contact> conn2 = [SELECT id ,PaymentConfimed__c from contact where id in: ids];
for(contact conn :conn2)
{
conn.PaymentConfimed__c = true;
conn3.add(conn);
}
update conn3;
I have two objects one is standard object(contact) and coustom(Payment__c) and thay have lookup from Payment to contacts .My requirement when ever payment record is created corresponding confirmpaymnt checkbox on contact should be tickked.
I have tried trigger but functionality not working can any one help me with this.
Thanks in Advance.
TRIGGER:
rigger checkboTrigger on Payment__c(after Insert) {
List<id> ids = new List<id>();
List<contact> conn3 = new List<contact>();
for(Payment__c pay: Trigger.new)
{
ids.add(pay.id);
}
List<contact> conn2 = [SELECT id ,PaymentConfimed__c from contact where id in: ids];
for(contact conn :conn2)
{
conn.PaymentConfimed__c = true;
conn3.add(conn);
}
update conn3;
List<id> ids = new List<id>();
for(Payment__c pay: Trigger.new)
{
ids.add(pay.contact__c);
}
List<contact> conn2 = [SELECT id ,PaymentConfimed__c from contact where id in: ids];
for(contact conn :conn2)
{
conn.PaymentConfimed__c = true;
}
update conn2;
}
Let us know if this will help you
Develop process builder flow on object Payment__c , you can update fields of its parent.