question

Upvotes
Accepted
1 1 1 1

To run KYC Process on multiple accounts at the same time

Hello,

We run the KYC process on our accounts/customers after certain criteria is met. It runs on one company which is associated with the current opportunity. I have a flow where after meeting certain criteria, I am calling the apex class - "Automate Screening" and input three parameters: This part is working as expected.

enableMonitoring - false

Objecttype - Account

recordid - id

But we have a new requirement. Sometimes, an account can have multiple other accounts/legal entities (with record type as Account) associated with it. At that time, after meeting certain criteria, users want the KYC Process to run for all Accounts - the parent account and associated accounts.

I want to understand if I can accomplish this in the flow.

Please let me know if you want me to provide you access to our sandbox to check out the flow.

thanks,

Pooja

#productscreening
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@pooja.arora

Hi,

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,


AHS


Upvotes
Accepted
61 1 1 3

Hi @pooja.arora like Andrei mentions you can achieve this in flows.

There are different ways to approach this objective. What is right for your org will depend on your data model within Salesforce for relating accounts. In this example we are using the ParentId relationship on the account record object.

1690460480942.png


When the entry criteria for this flow is met (a check box “screen child account” is set to true on the parent record), we look up the related child records using the “Get Records” action, and then use a “Loop” action to cycle through the results calling the Automate Screening Apex action for each one before ending the process. This example is going to create the screening events for the parent and the child accounts at the same time.

The flow could look something like this:1690460505156.png




1690460480942.png (35.1 KiB)
1690460505156.png (34.8 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
24.7k 54 17 14

Hello @pooja.arora

Thank you for reaching out to us. I am contacting the World-Check/Screening team to look into your question.

I will give you more updates as soon as I receive any information from the team.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
546 4 0 2

Hi @pooja.arora,

To perform multiple screenings at the same time, this endpoint - "SEQ-case-save-and-screen-cases: Save and screen multiple cases" can be used. However, all of the cases would be treated as separate cases and there would be no concept of parent and associated cases between them. If this relationship needs to be maintained, another endpoint - "[SEQ-linked-cases-create-links]: Create links between cases" can be used. I have also attached a link to our documentation for your reference - Refinitiv World-Check One API. Please revert to me in case of any questions. Thank you.

Regards,

Ssneha Balasubramanian.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1 1 1 1

Hey Ssneha, Just to clarify I am not using code to run this automation. Earlier I was using process builder and now flow since Salesforce is retiring process builder and workfkow rules. So I need to understand the solution that I can implement in a flow. I am not sure if this documentation can help me with that. It'll be much quicker if we can have a call scheduled. thanks.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
546 4 0 2

Hi @pooja.arora,

Please send me an invite between 9 a.m. - 6 p.m. IST and I'd be happy to discuss this. Thank you.

Regards,

Ssneha Balasubramanian.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1 1 1 1

Hi Ssneha, I don't have your email. My email is pooja.arora@bp.com

Either send me your email or send me an invite for 6pm IST. That would be 8:30 am my time.


Thanks,

Pooja

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1 0 0 1

Hi @pooja.arora,
you can accomplish your goal in the flow. In the flow you need to get all Accounts (using Get Record block) that need to be screened and using iterator (Loop block) for example call the same apex class - "Automate Screening" and input three parameters as you did for one record. It's one of the option that should work for you.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
61 1 1 3

Continued....

GET RECORDS

You are going to want to limit the records that you are fetching, e.g. where parent ID = the record ID of the account initiating the flow. Remember there are API limits that no more than 1000 records can go through the API in one go via real time trigger. If you have a very large hierarchy you would need to consider the impact of this limit in your flow.

1690460670058.png

LOOP:

You then loop the records in the collection

1690460723981.png



1690460670058.png (31.1 KiB)
1690460723981.png (128.9 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
61 1 1 3

@pooja.arora please do add any clarifications that you need but I hope this answered your question more fully.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

KYC Process flow for multiple accounts.pdf

@Hannah.Quinn Thanks Hannah.

I created almost the similar flow that you have shown above. And I have attached a file with the flow and individual screenshots for your reference.

The challenge that I am facing is when I call the Automate Screening apex class, I do not get an option to pick my list variable that I created in the step above after looping through all child accounts.

Can you share that part of your flow. What is the input variable that you are using to call your apex class?


Upvotes
61 1 1 3

Hi @pooja.arora try referencing { Loop_throught_each_Affinity_Account.Id} I am not quite clear what your Assignment actions are trying to do.

This is a screenshot from my org why I reference my loopname.id.

1690481822771.png


1690481822771.png (49.6 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1 1 1 1

@Hannah.Quinn Thanks Hannah.

Thanks Hannah,

I did try to add the collection variable/list that I created after looping through all the affinity accounts but the input variable in the apex action clearly says: recordId. Looks like it’s expecting only one id and not the collection. Can you please verify why it isn't taking a collection variable? Does it have anytihng to do with the apex class itself?

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@Hannah.Quinn @Karolina.Wisniewska

Can you please take a look at my comments and please get back to me. I have been trying to get this resolved for quite sometime now. Thank you.

<private comment>

Hi @Hannah.Quinn, @Karolina.Wisniewska ,

Can you please check the follow up question from the user?

Thanks,
AHS

Upvotes
1 1 1 1

@Hannah.Quinn @Karolina.Wisniewska

Can you please respond. This has been open for way too long. I am not sure what's the hold-up. But I would like to escalate this ticket.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1 0 0 1

Hi @pooja.arora,

Inside the flow, we work with all related child accounts. But since in our case the method (Invocable method) inside the apex class only supports passing one account at a time (RecordId), we have to pass accounts one at a time in a loop.

Second option we can write the logic in apex trigger that will looks like below that will pass collection:

trigger AccountTrigger on Account (after insert) {

if(trigger.isInsert){

List<tr_wc1.tr_automateScreening.automateScreeningVars> sCaseVars = new

List<tr_wc1.tr_automateScreening.automateScreeningVars>();

for (Account acc : Trigger.new){

tr_wc1.tr_automateScreening.automateScreeningVars item = new

tr_wc1.tr_automateScreening.automateScreeningVars();

item.enableMonitoring = false;

item.objectType = 'Account';

item.recordId = acc.Id;

sCaseVars.add(item);

}

tr_wc1.tr_BulkCreateAndScreenCases batch = new

tr_wc1.tr_BulkCreateAndScreenCases(sCaseVars);

Database.executeBatch(batch, 30);

}

}

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@Andrei_Rytik

Thanks Andrei. So, to clarify, do we write the trigger ourselves or are you guys going to do that for us? Since it's a managed package class, I want to be sure before we start doing anything ourselves.

Please let me know.




Hi @Andrei_Rytik ,

Could you please check the follow-up question from the user?

Thanks,
AHS

Hi @pooja.arora,

In case that you could add additional logic when case need to be created and we don't have access to your environment it needs to be done on your side.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.