You need to sign in to do that
Don't have an account?
Pedro Salles
How to make a trigger call a apex class to send data via post
Hello,
I'm new to salesforce and need to develop an apex class that captures contract data and sends it to a partner Webservice. It was recommended to use callout with triggers, but in the materials I found, it does not have much content on how to do it.
Can anybody help me?
Thank you
I'm new to salesforce and need to develop an apex class that captures contract data and sends it to a partner Webservice. It was recommended to use callout with triggers, but in the materials I found, it does not have much content on how to do it.
Can anybody help me?
Thank you
Create an Apex class with callouts .. update the URL and BODY and auth details and parse the response
Invoke it from the trigger
Refer this link
https://trailhead.salesforce.com/en/modules/apex_integration_services/units/apex_integration_rest_callouts
https://salesforcelearningpoint.wordpress.com/2016/11/08/future-method-invocation-from-apex-trigger/
Following your tips, i set up my apex class and my trigger:
Apex:
Trigger: But I had some doubts:
How to pass the contract ID through Trigger? This Id i will use in my query condition.
How can I test my trigger? When I try to test through the Developer Console it gives me the following error message:
"Line: 1, Column: 2
Unexpected token 'trigger' "
I'm new to Salesforce development and i do not find many references to this kind of service.
I already did the Trailhead, but it limits me in some points.
Could you help me with some kind of material about it?
Thanks a lot for the help.