cancel
Showing results for 
Search instead for 
Did you mean: 

RESTRICT DUPLICATE MANUAL SERIES IN PO UPON APPROVAL PROCESS

leanjohn
Explorer
0 Kudos
208

Hi Experts,


I would like to know what is the error in my store procedure below;

IF @Object_type = N'112' and @transaction_type in ('U','A')
BEGIN
IF EXISTS
(SELECT * FROM ODRF A where A.ObjType='22' and A.Series='-1' and A.WddStatus<>'-' and A.DocEntry=@list_of_cols_val_tab_del
AND A.DocNum in (select C.DocNum from ODRF C where C.ObjType='22' and C.Series='-1' and C.WddStatus<>'-'))
BEGIN
Set @error = 11222
Set @error_message = N'Document Number is already exists in Approval Process.'
END
END

I would like to restrict adding PO when the manual document number is already exists in Approval Process.

But it seems not working.


Regards,

lean

View Entire Topic
leanjohn
Explorer
0 Kudos

Hi Aziz,

No luck at all, but it seems that it is not working, it always exist due to the DocEntry=@list_of_cols_val_tab_del

Does anyone knows how to do it right.

Regards!