Certified Platform Developer II Exam QuestionsBrowse all questions from this exam

Certified Platform Developer II Exam - Question 36


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?

Show Answer
Correct Answer: D

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.

Discussion

5 comments
Sign in to comment
Rocky_sfdcOption: D
Jan 22, 2021

D is the answer. As Process Builder Required both @future and @Invocable ... ths why is not A.

KK13Option: D
Dec 30, 2021

https://salesforce.stackexchange.com/questions/202350/invocablemethod-process-pluginresult-and-future

abhichauhanOption: A
Jan 19, 2021

why not A..process can also do the same with less code approach

Not_NamOption: B
Jul 18, 2023

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.

AnjindalOption: B
May 21, 2024

Ans is B