Skip to Content
0
Former Member
Oct 30, 2008 at 12:31 AM

Stored Procedure for restrict to close documents

794 Views

Hi,

I want to create a Stored Procedure for restrict to close sales orders for some users, because in Standard Authorizations you have one option to restrict to close, but I need that some users can close quotations and also this users can´t close sales orders. I have this query :

F @object_type='17' AND (@transaction_type='a' or @transaction_type='U' )

BEGIN

IF EXISTS (

SELECT T0.DOCENTRY FROM adoc T0 WHERE T0.[ObjType] = '17'

AND T0.[UserSign] = '1' AND T0.[DocStatus] = 'C' AND

T0.DOCENTRY= @list_of_cols_val_tab_del )

BEGIN

SELECT @Error = 1, @error_message = 'You are not permitted to close Sales Orders'

END

END

But It doesn´t work. I need help!!!

Thanks