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
chandra prakash 58chandra prakash 58 

i want a trigger when a custom lookup field are null then other two custom currency field also null

object[quote line__c] have a lookup field [product master__c] with product object and two custom currency field  one  is base_price__c and other selling_price__c.
I want a trigger, 
when removing the product from the lookup field then automatically assign the null value in the other two mentioned field.

please help.
chandra prakash 58chandra prakash 58
i have written this
i  have written this. 
But i got an error when I want to update the record.error
Footprints on the MoonFootprints on the Moon

Hi Chandra,

This error is "Maximum Trigger depth exceeded" because when you execute update qt,
the same trigger is called again and again as this is "After Update".

Change this into "Before update", and remove "update qt" (Line 17) statement. As trigger will update it by itself!
Also see if you can utilize Trigger.new to loop over new version of records updated.

Let me know if this helps!

chandra prakash 58chandra prakash 58
record field  is not updating.