function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nashle PakNashle Pak 

What technical solution?

Hello,

Can not find a viable solution to my problem.

When creating an account record, the user must also create an associated object.

When he enters the SIREN number (national company ID) I want to interoperate an API to check that the company is registered in the national repository and then retrieve the company information to complete certain fields of the registration.

1. I first imagined the following solution: On the creation screen of the associated record, display a button on the SIREN field to perform the actions. Alas, it does not seem possible to develop this solution without it requires a lot of development time and learning.

2. The second imagined solution is as follows: A trigger triggered before the registration checks whether the SIRET exists and adds the additional information to the record. Alas, the API call in a trigger is impossible and when it is via the use of a method of an annotated class apex @future, I can not return a list of records.

3. I am now thinking of using flow and see if it will be possible for me to solve all these constraints.

My questions :

1. For my 1st solution, can you confirm to me that it requires to write either a visualforce specific screen for the creation of the recordings and to use JS or worse, to develop lightning components. Can not we integrate a button into a field on standard screens?

2. For my 2nd solution, how can I use a trigger that queries an external API and perform my operations on the records being created?

Thank you very much for your answer.
Best Answer chosen by Nashle Pak
Nashle PakNashle Pak
Hello all,

I finally used the flow builder, it was the only solution that allowed me to respond to my need without doing specific.

Regards,