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
NaishadhNaishadh 

Inline editing fails to execute trigger

Hi,

 

I am facing some strange behaviour. I have developed before insert trigger on lead.

 

If user edit the record by clicking on edit button link, trigger is executing properly but not in the case of inline editing. 

 

Please guide!

Best Answer chosen by Admin (Salesforce Developers) 
Nick34536345Nick34536345
you said "before insert"? inline editing won't trigger a before insert, you'll need a before or after update.

All Answers

Nick34536345Nick34536345
you said "before insert"? inline editing won't trigger a before insert, you'll need a before or after update.
This was selected as the best answer
NaishadhNaishadh

Hi,

 

sorry my mistake. It is after insert and after update trigger.

 

Here is the code.

 

trigger caseTrigger on Case (before insert, before update) { for(Case c : Trigger.new) { if(c.Last_Modified_by_User__c == null || c.Last_Modified_Date_Time__c == null) { c.Last_Modified_by_User__c = Userinfo.getUserName(); c.Last_Modified_Date_Time__c = System.now(); } } }