1

On an object detail page, I want that once the user clicks on the save button, the object is saved, and a web service callout is executed. Thus, the user feels it's a "normal" save. Is there a way to do that without VF page ?

I first created a button which executes JS code, calls a class executing the callout and inserting the object, but I cannot place the button in the edit-mode page.

Thanks

1

There is no way to override save button and place that on edit page. Why dont you write a trigger on Insert & update and invoke a future method and do a callout.

  • Yes, I would go for the trigger too, perhaps in an @future call as @crmprogdev said – mkorman Jan 13 '16 at 17:00
1

You'd need to do this either with a custom controller and VisualForce page that replaced the standard page or else using a trigger that fired on after AfterInsert/AfterUpdate. A custom controller could make a call to your web class as part of the save method. There are limits surrounding this in terms of response time so it might be best to put that into an @future call.

  • 1
    and pay attention to governor limits with triggers and future – cropredy Jan 13 '16 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.