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 : Trigger.new) {
SensorsHandler.SensorEvent sensorEvent = new SensorsHandler.SensorEvent();
sensorEvent = SensorsHandler.parseSensorJSON(event.JSON_Event__c);
SensorsHandler.generateMonitorFromEvent(sensorEvent);
}
}
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.