on 07-11-2014 10:15 AM
Dear Expert,
I have three user 01,02,03 & everyone add sale order ,but i want to give edit option to 01 user only so i create following SP
IF @transaction_type ='U'And @object_type ='17'
BEGIN
If Exists(SELECT T1.DocEntry from ORDR T1
Inner Join dbo.OUSR T2 On T1.userSign = T2.UserId
WHERE T1.docentry = @list_of_cols_val_tab_del AND T2.USERID != 01)
Begin
SELECT @error = 1, @error_message ='This user is Not Allowed to update sale Order'
End
END
If i wrong Correct me because above result not working properly
Hi,
Try:
IF @transaction_type ='U' And @object_type ='17'
BEGIN
If Exists(SELECT T1.DocEntry from ORDR T1
WHERE T1.docentry = @list_of_cols_val_tab_del AND T1.USERSIGN2 != 1)
Begin
SELECT @error = 17, @error_message ='You are not allowed to update sale Order!'
End
END
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Please Try the below code,
IF @object_type = '17' and @transaction_type in ('U')
Begin
If Exists (SELECT T0.[DocEntry] FROM ORDR T0
INNER JOIN RDR1 T1 ON T0.[DocEntry] = T1.[DocEntry]
INNER JOIN OUSR T2 ON T0.[UserSign] = T2.[USERID]
WHERE T0.[UserSign] in('02','03','04') AND T0.DocEntry = @list_of_cols_val_tab_del)
Begin
SET @error = 1
SET @error_message = 'You are not Authorized to Update Sales Order'
End
End
It will fullfill your requirement.
Best Regards,
S.K.Behera
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jay,
Please check below.
IF @transaction_type ='U'And @object_type ='17'
BEGIN
If Exists(SELECT T1.DocEntry from ORDR T1
Inner Join dbo.OUSR T2 On T1.userSign = T2.UserId
WHERE T1.docentry = @list_of_cols_val_tab_del AND T1.userSign <> '01')
Begin
SELECT @error = 1, @error_message ='This user is Not Allowed to update sale Order'
End
END
Hope this helps
--
--
Regards::::
Atul Chakraborty
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You have to compare user sign with current user ID to block sales order.
Thanks & Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try
IF @transaction_type ='U'And @object_type ='17' BEGIN If Exists(SELECT T1.DocEntry from ORDR T1 WHERE T1.docentry = @list_of_cols_val_tab_del AND T1.UserSign2 <>1) Begin SELECT @error = 1, @error_message ='This user is Not Allowed to update sale Order' End END
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
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.