on 2022 Aug 11 7:40 PM
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!
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.