Within the HANDLING_UNIT_SHIPMENT (Shipment > Handling Unit Structure > Handling Units) there is a field MANUAL_GROSS_WEIGHT and we have created a custom field CF$_MANUAL_NET_WEIGHT
- The user will enter the Manual Gross Weight and the custom field Manual Net Weight values.
On saving the record we would like the custom event to check the custom field Manual Net Weight value against the Manual Gross Weight and if it is greater than or equal to the Manual Gross Weight then an error message must be displayed:
If the Manual Gross Weight already exists and the user only enters the custom field Manual Net Weight then there is no issues.
DECLARE manual_gross_weight_ NUMBER;
PRAGMA AUTONOMOUS_TRANSACTION;
CURSOR get_data IS
SELECT manual_gross_weight FROM HANDLING_UNIT_CFV WHERE objkey = '&NEW:ROWKEY' ;
BEGIN
OPEN get_data;
FETCH get_data INTO manual_gross_weight_;
CLOSE get_data;
IF '&NEW:CF$_MANUAL_NET_WEIGHT' >= manual_gross_weight_
THEN Error_SYS.Record_General('HandlingUnitHistory', 'CHECKWEIGHT: The Manual Net Weight must be LESS than the Manual Gross Weight! Please amend.' );
END IF;
END;
However, as the values are being entered at the same time then the Manual Gross Weight doesn’t really exist so cannot be verified against.
Am I missing anything?