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
Kevin Yao 4Kevin Yao 4 

Trigger isn't running after Custom Object Insertion from REST API

I'm having some issue with having a trigger run after inserting an object from a Rest API call. I've confirmed that the object is being created, and I've tested the other sections of the code manually and they are fine.

Here's my code
Sensor_Event__c event = new Sensor_Event__c();
event.JSON_Event__c = requestBody.toString();
insert event;
(I've checked and the object has the correct event with the correct string)

Here's my trigger
trigger ProcessSensorEvent on Sensor_Event__c (after insert) {
        for(Sensor_Event__c event : {
            SensorsHandler.SensorEvent sensorEvent = new SensorsHandler.SensorEvent();
            sensorEvent = SensorsHandler.parseSensorJSON(event.JSON_Event__c);

I've tried inserting the same object from the exernal rest API in manually and the trigger code runs properly, and the object is created by the rest api without issue, but when the object is created by the REST API, the trigger doesn't run. Any help would be appreciated.
SubratSubrat (Salesforce Developers)