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
Pavan KembaPavan Kemba 

Trigger not invoked for OrderItem

We have a object called OrderItem for Order.
  • I have written a trigger on OrderItem Object to update the object.
  • When i try updating from Salesforce UI, the trigger is invoked.
  • But when the data is from External System [SAP in my case], the trigger is not invoked.

Below is the Trigger Code:
trigger OrderLineTrigger on OrderItem (after insert,before update,before insert,after update) {
	OrderLineHandler objlineHandler = new OrderLineHandler();

if(Trigger.IsBefore || Trigger.IsUpdate)
{
   objlineHandler.beforeInsertUpdate(Trigger.new,Trigger.oldMap);
}
}


Please help me on this.
pconpcon
There is no reason that I can see why this would not fire.  Is the trigger active?  Do you see anything in the debug logs?  If if is active and it you see the trigger in the debug logs then can you please include the OrderLineHandler.
Pavan KembaPavan Kemba
The trigger status is Active. The trigger is not firing at all and i dont see it in Debug logs as well.
The OrderItem is a child Object of Order. So the trigger on Order is firing and not the for child object.
My senario is :
  1. The Order along with OrderItem is pushed from SAP to SFDC.
  2. When the above step is executed, the triggers of both Order and OrderItem are fired. [basically this is an Insert Operation and are availble in Debug Logs]
  3. Then we have only OrderItems from SAP, which are to be updated. In this senario, only the trigger of Object is fired and not the OrderItem.
  4. Wierd thing, when i manually Update it from SFDC, i see the Trigger Fired, but not when it is from SAP to SFDC [they are using upsert operation]