+ 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(); } } }