cancel
Showing results for 
Search instead for 
Did you mean: 

How to catch Customer Creation event and its data in CCO Backend

AaronMendieta
Participant
0 Kudos
430

Hi Experts!

I need to catch in the backend the Customer Creation event as well as the data entered in the form.

Based on CCO console log I have been trying to achieve this via the next SAP (importing com.sap.scco.ap.pos.service, com.sap.scco.ap.pos.i14y.central.customer, com.sap.scco.ap.pos.service.impl,) classes and methods:

//****** TEST 1
@PluginAt(pluginClass= BusinessPartnerPosService.class, method="create", where=POSITION.BEFORE)

//****** TEST 2
@PluginAt(pluginClass= CustomerDataPosService.class, method="findOrCreate", where=POSITION.BEFORE)

//****** TEST 3
@PluginAt(pluginClass= CustomerDTO_CentralWebServiceImpl.class, method="post", where=POSITION.BEFORE)

//****** TEST 4
@PluginAt(pluginClass= BusinessPartnerErpServiceImpl.class, method="sendToBackend", where=POSITION.BEFORE)

//****** TEST 5
@PluginAt(pluginClass= BusinessPartnerErpServiceImpl.class, method="sendToERP", where=POSITION.BEFORE)

//****** TEST 6
@PluginAt(pluginClass= BusinessPartnerPosServiceImpl.class, method="create", where=POSITION.BEFORE)
		
//****** TEST 7
@PluginAt(pluginClass= BusinessPartnerPosServiceImpl.class, method="createFromDTO", where=POSITION.BEFORE)

//****** TEST 
@PluginAt(pluginClass= BusinessPartnerPosServiceImpl.class, method="updateFromDTO", where=POSITION.BEFORE)<br>

However, none of them seem to be triggered when debugging.

I have tried to do it via eventBus with JS as well, I succeed in catching the event when the creation form is triggered, naturally the payload of this event does not contain any data of the customer that is going to be created:

Any comment or guidance will be truly appreciated, thanks in advance, best regards!

Accepted Solutions (0)

Answers (2)

Answers (2)

Klaus_Frick
Active Participant
0 Kudos

Hi pamt

With FP12 I catch Customer Creation & Updates with:

@PluginAt(pluginClass = BusinessPartnerErpService.class, method="sendToBackend", where=POSITION.BEFORE)

With args[0] you should get the BusinessPartnerEntity. To identify if this is a creation or a update, I do query with the ExternalId (with BusinesspartnerManager) to get the possible old BusinessPartnerEntity. Maybe this helps.

But I agree with Robert, that a own UI would be the best solution.

Best Regards

Klaus

AaronMendieta
Participant
0 Kudos

Hi Mr. Frick, thanks in advance for taking the time to answer!

This event has responded when debugging, however, I have realized that the ID assignment process is not performed by CCO but CCOM, therefore at POSITION.BEFORE there is no customer ID to be fetched.
I have changed it to POSTION.AFTER but the event does not respond when debugging using this parameter.

Do you know if there is any other way to catch the event once the ID has been generated ID?

Any guidance will be appreciated, best regards!

R_Zieschang
Contributor
0 Kudos

Hi pamt,

currently there is no way to catch the bp data on UI level. I created an influence ticket for that topic. If not already voted, please vote. 🙂

In several other projects we ended up creating our own UI for customer creation to implement additional fields as well as validation of fields.

Regarding the PluginAt annotations, let me check, which method is triggered, but I am 99% sure one of them must be triggered.

Regards

Robert

AaronMendieta
Participant
0 Kudos

Hi Robert, hope you are doing great!

Could you please share the influence ticket URL so that we can vote? 🙂

I do appreciate it, it would be great if you could check/test my listed methods!

I do thank you for your help, best regards!