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
muraimurai 

トリガの処理回数について

 

お世話になっております。
トリガについての質問です。
オブジェクトAが更新されるタイミングにて
オブジェクトBを更新するトリガを実装していますが、
何故か2回処理が行われてしまいます。
原因等わかればご教授下さい。
以下、ソースです。
trigger Kasantrigger on objA (before update) {
/*  更新時の処理  */
    if(trigger.isupdate){
        List<objA > resultso = trigger.old;
        List<objA > resultsn = trigger.new;
        string ycdo = resultso[0].BG_copy__c;
        decimal shikkouo = resultso[0].dbam__c;
    /*旧情報更新*/
        List<objB> contactso = [Select ID, NAME,cBGdb__c From objB WHERE NAME = :ycdo LIMIT 1];       
        if(contactso.size() > 0){
            contactso[0].cBGdb__c = contactso[0].cBGdb__c - shikkouo;
            update contactso;
         }
    }
}

 

 

tajimatajima

オブジェクトAに項目自動更新のWorkflow Ruleが設定されていませんか?

あるいは、オブジェクトBにトリガが設定されていてその中でオブジェクトAの更新処理がありませんか?