on 2021 Jan 07 4:23 PM
Hello all,
when I try to get the (object receipt) on the screen, on some PCs the object arrives fine, but on others it arrives null with the following error:
'"Cannot invoke "com.sap.scco.ap.pos.entity.ReceiptEntity" because "receipt" is null"
This is my java code:
CDBSession cdbSession = CDBSessionFactory.instance.createSession();
ReceiptPosService receiptManager = ServiceFactory.INSTANCE.getOrCreateServiceInstance(ReceiptPosService.class, cdbSession);
ReceiptEntity receipt = receiptManager.findOrCreate(UserRegistry.INSTANCE.getCurrentUser(), null, true);
Does anyone know why this happens?
Request clarification before answering.
Hello josehrmatos ,
This can happen if your method executes while no receipt is currently in progress.
Please set the noAutoCreate parameter of the findOrCreate method to false, so that CCO creates a new receipt in that case:
ReceiptEntity receipt = receiptManager.findOrCreate(UserRegistry.INSTANCE.getCurrentUser(), null, false); Hope this helps,
Joerg.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.