'WHEN-VALIDATE-RECORD in custom.pll
i have to throw a message box in a Fom ,whenever a "serial num" is enetered it should check with the database where the serial no has not been repaired or received more than thrice.
so when i'm trying to do the same with custom .pll my code is .i'm getting errors .where should i modify the code .please help .
if (event_name = 'WHEN-VALIDATE-RECORD') then
if (form_name = 'CSDREPLN') then
if (block_name = 'REPAIRS') then
iSELECT COUNT(*)FROM CSD_REPAIRS CR, CS_INCIDENTS_ALL_B CS, CSD_PRODUCT_TRANSACTIONS CP
WHERE CR.REPAIR_LINE_ID = CP.REPAIR_LINE_ID
AND CR.INCIDENT_ID = CS.INCIDENT_ID
AND CS.ACCOUNT_ID := SR.ACCOUNT_NUMBER
AND CP.prod_txn_status = 'RECEIVED'
AND CR.STATUS = 'C'
AND CP.SOURCE_SERIAL_NUMBER := REPAIRS.SERIAL_NUMBER group by CP.SOURCE_SERIAL_NUMBER having count(*) >2;
fnd_message.set_string ('SERial Num has been repaired more than 3 times ');
fnd_message.show ();
RAISE form_trigger_failure;
end if;
end if;
end if;
end if;
end custom;