A company wants to incorporate a third-party web service to set the Address fields when an Account is inserted, if they have not already been set.
What is the optimal way to achieve this?
A company wants to incorporate a third-party web service to set the Address fields when an Account is inserted, if they have not already been set.
What is the optimal way to achieve this?
In Salesforce, the optimal way to make callouts to third-party web services is to use Asynchronous Apex, particularly the @future method with callout=true. Since the requirement is to set the Address fields after an Account is inserted and they have not already been set, using an after insert trigger ensures that the record is committed to the database before making the callout. Therefore, creating an after insert trigger and calling an @future(callout=true) method from it is the best practice for this scenario.
D is the answer. As Process Builder Required both @future and @Invocable ... ths why is not A.
https://salesforce.stackexchange.com/questions/202350/invocablemethod-process-pluginresult-and-future
why not A..process can also do the same with less code approach
C and D can't update Address field in After context A use @future annotation =>It's made async function, so that we can't catch value of Address field by sycn way I'll will go for B answer, which the best choice I considered.
Ans is B