on 10-22-2014 9:16 AM
Hello EveryOne,
I have came across a situation that only user "Manager" can Post Journal Voucher other user can't, whereas other users can Add Journal Voucher but cannot POST it.
Thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i had restricted sales order..by using below code..
U just modify some data.
and also refer the table ousr and journal voucher tables for getting the usersign...
IF (@object_type = '17') and (@transaction_type IN ('A', 'U'))
BEGIN
IF EXISTS (SELECT T0.Docentry from ORDR T0 Inner Join RDR1 T1 ON T0.Docentry=T1.Docentry where
T1.DocEntry = @list_of_cols_val_tab_del and ((T0.[UserSign] =1)))
BEGIN
Select @error = 10, @error_message = 'Your are not allowed to add the docuemnt'
END
END
---
through the coding also u can restrict user wise if u need..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Srinivas,
Please have a look on it...It gives me strange error that "Error while converting Nvarchar to int", whereas i have checked its data types.
IF (@object_type = '28') and (@transaction_type IN ('A', 'U'))
BEGIN
IF EXISTS (SELECT T0.BatchNum from OBTD T0
where T0.BatchNum = @list_of_cols_val_tab_del and T0.[UserSign]=1)
BEGIN
Select @error_message = 'Your are not allowed to add the document'
END
END
Regards,
Idrees
Hi,
Try adding Convert(datatype,field)
ex:
IF (@object_type = '28') and (@transaction_type IN ('A', 'U'))
BEGIN
IF EXISTS (SELECT T0.BatchNum from OBTD T0
where T0.BatchNum = convert(int,@list_of_cols_val_tab_del) and T0.[UserSign]=1)
BEGIN
Select @error_message = 'Your are not allowed to add the document'
END
END
or try the one below.
IF (@object_type = '28') and (@transaction_type IN ('A', 'U'))
BEGIN
IF EXISTS (SELECT T0.BatchNum from OBTD T0
where convert(int,T0.BatchNum) = @list_of_cols_val_tab_del and T0.[UserSign]=1)
BEGIN
Select @error_message = 'Your are not allowed to add the document'
END
END
please take note if the BatchNum field datatype is nvarchar you should use the nvarchar(character size) ex: nvarchar(20) as datatype instead. same with the @list_of_cols_val_tab_del both field/parameter should be the same datatypes.
jim
User | Count |
---|---|
94 | |
11 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.