You need to sign in to do that
Don't have an account?
Amay
How do i support custom object information on create/update to external system?
Currently, I'm supporting custom object integration with external system through triggers and future callouts, but it seems like if a customer is mapping that custom object then he would have to create a trigger manually with standard code (common for standard objects) in salesforce calling TriggerHandlerClass and FutureCallouts. Is there any better way to do custom object's integration?
My Trigger code looks like
trigger Custom_object_webhook on Custom_webhook (after insert, after update) {
if (Trigger.isInsert || Trigger.isUpdate) {
TriggerHandlerClass.isInsertOrUpdate(trigger.new, trigger.oldMap);
}
}
public class TriggerHandler {
//calls Utility class for callouts
}
global class Utility {
@future(Callout=true)
public void sendMethod () {
// request.setEndpoint(callout_URL);
request.setMethod('POST');
request.setHeader('Content-Type', 'application/json;charset=UTF-8');
request.setBody(payload); //payload is custom object/standard object info on create/update
}
}