Hi Experts,
We create a custom table and service for this table in our extension.
this table is used to record the the posted sales shipment No. and Posted sales Inovice No. after we post the sales order.
Now one of our customer always encounter problem like below,
{"error":{"code":"Internal_EntityWithSameKeyExists","message":"The record in table TRCCreateShipmentsNew already exists. Identification fields and values: SoNum='S-SHPT103999' CorrelationId: 9838540c-8c47-4265-9c7b-e2ea0a73b7cf."}}

but actually this shipment No. is no existed in the 365BC company. I also find this shipment is the Ending No. we set for posted Sales Shipment in the "No. Series"
Below is a screenshot for the trigger OnInsert for the table, after we call code unit for the post shipment, we will get the last record in the "Sales Shipment Header".
I am not able to reproduce this issue in my local environment, I am confused for it.Can anyone shed me some lights on this issue?

Thanks