function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sunil Kumar 545Sunil Kumar 545 

if contact as two checkbox (accept and reject) and lookup with two object contact and book.if we accept in contact object it automatically accept in book object using triggers

Ajay K DubediAjay K Dubedi
Hi Sunil,

Please try this code.

trigger UpadteBookCheckBoxTrigger1 on Contact (after update) {
    set <id> IdCollect = new Set<Id>(); 
    for(Contact con:Trigger.New){
    List <Book__c> bkList = [SELECT Accept__c From Book__c WHERE Id IN :IdCollect];
    for(Contact c:Trigger.New){
            for(Book__c bk:bkList){
    update bkList;
Please mark it as best Answer if you find it helpful.

Thank You
Ajay Dubedi
Sunil Kumar 545Sunil Kumar 545
In contact only have create accept and reject checkbox  but in book object have to create picklist value like status=accept,reject,pending.if contact checkbox accept book object also be accept,if its rejected same thing,record created means pending uisng triggers
Sunil Kumar 545Sunil Kumar 545
can anyone tell this requirement?