Hi All,
I just need some guidance on an issue I'm having, I have some code that creates a new manifest record if one isn't found.
SNIP OF CODE
I know a record isn't found as the iCnt4 has a value and therefore one should be created for an order and box record however it fails. The error logged in the app server is as follows
[25/11/12@10:21:12.562+0000] P-000000 T-013300 1 AS -- (Procedure: 'NLUPSTrackUpdate.r' Line:1508) ** Manifest already exists with Carrier Code "" ConsignmentNumber "DEL04266434". (132)
Now the database table does have an existing record with the same ConsignmentNumber and a blank ShippingMethod but a different order number. Having looked further into it the manifest table, the ConsignmentNumber and ShippingMethod have been set as a Primary Unique Index and both fields have not been set as Mandatory.
Question 1
Has my new record been correctly stopped from being created, as I already have an existing record with the same ConsignmentNumber and ShippingMethod ?
(The app server log states the CARRIER CODE as that is the fields label, field name is Shipping Method).

The reason I'm confused is because the database table has thousands of records with the same ConsignmentNumber and ShippingMethod but with different Order
Numbers...
Question 2
How could duplicate records be created with the same ConsignmentNumber and ShippingMethod?
I've already asked the question to see if the database table properties\scheme were changed but apparently it's always been the same.
TABLE INDEXES IF IT HELPS FURTHER.

Thanks in advance
I just need some guidance on an issue I'm having, I have some code that creates a new manifest record if one isn't found.
SNIP OF CODE
Code:
FIND FIRST Manifest
WHERE Manifest.ArEntity = Order.ArEntity
AND Manifest.OrderNumber = Order.OrderNumber
AND Manifest.ConsignmentNumber = Boxes.BoxBarcode
NO-LOCK NO-ERROR.
IF NOT AVAILABLE(Manifest) THEN
DO:
iCnt4 = iCnt4 + 1.
CREATE Manifest.
ASSIGN Manifest.ConsignmentNumber = Boxes.BoxBarcode
Manifest.CustomerACCode = Order.Shipto
Manifest.CustomerName = Order.ShipName
Manifest.Address1 = Order.ShipAddress1
Manifest.Address2 = Order.ShipAddress2
Manifest.Address3 = Order.ShipAddress3
Manifest.Country = Order.ShipCountry
Manifest.PostCode = Order.ShipPostCode
Manifest.Weight = string(Boxes.Weight)
Manifest.DespatchRef1 = Boxes.ShipmentTrackingNumber
Manifest.licenceplateno = int64(Boxes.ShipReference)
Manifest.OrderNumber = Order.OrderNumber
Manifest.ServiceID = Order.ServiceID
Manifest.ArEntity = Order.ArEntity
Manifest.DespatchNumber = Boxes.DespatchNo.
END.
I know a record isn't found as the iCnt4 has a value and therefore one should be created for an order and box record however it fails. The error logged in the app server is as follows
[25/11/12@10:21:12.562+0000] P-000000 T-013300 1 AS -- (Procedure: 'NLUPSTrackUpdate.r' Line:1508) ** Manifest already exists with Carrier Code "" ConsignmentNumber "DEL04266434". (132)
Now the database table does have an existing record with the same ConsignmentNumber and a blank ShippingMethod but a different order number. Having looked further into it the manifest table, the ConsignmentNumber and ShippingMethod have been set as a Primary Unique Index and both fields have not been set as Mandatory.
Question 1
Has my new record been correctly stopped from being created, as I already have an existing record with the same ConsignmentNumber and ShippingMethod ?
(The app server log states the CARRIER CODE as that is the fields label, field name is Shipping Method).

The reason I'm confused is because the database table has thousands of records with the same ConsignmentNumber and ShippingMethod but with different Order
Numbers...
Question 2
How could duplicate records be created with the same ConsignmentNumber and ShippingMethod?
I've already asked the question to see if the database table properties\scheme were changed but apparently it's always been the same.
TABLE INDEXES IF IT HELPS FURTHER.

Thanks in advance
Last edited: