on 04-30-2015 4:42 AM
Hi,
I would like restrict one of my raw material warehouse for all users expect two users. If the will move the qty from RM to Others warehouse need to restrict for all the user expect two user how we will do that . is it any store procedure ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have created the Sp but here i need small changes . user sign 29, 30,67 when ever they make inventory transfer it should be work. but below SP working opposite. kindly correct this.
if (@object_type = '67') and (@transaction_type IN ( 'A','U'))
BEGIN
IF exists (select T1.DocEntry FROM OWTR T0
INNER JOIN WTR1 T1 ON T0.[DocEntry] = T1.[DocEntry]
where T1.DocEntry =@list_of_cols_val_tab_del and t1.WhsCode='ExRm' and t0.UserSign in ('29','30','67'))
Begin
SET @error = 30
SET @error_message =N'You are not authorized to Put the stock to this Warehouse'
end
END
Hi,
Try this out:
IF (@object_type = '67') and (@transaction_type IN ( 'A','U'))
BEGIN
IF exists (select T1.DocEntry FROM OWTR T0
INNER JOIN WTR1 T1 ON T0.[DocEntry] = T1.[DocEntry]
WHERE T1.DocEntry =@list_of_cols_val_tab_del and t1.WhsCode='ExRm' and t0.UserSign not in ('29','30','67'))
Begin
SET @error = 30
SET @error_message =N'You are not authorized to Put the stock to this Warehouse'
end
END
Regards,
Hi ramesh
Try This
IF (@object_type = '67')
AND (@transaction_type IN ('A', 'U'))
BEGIN
IF EXISTS (
SELECT T1.DocEntry
FROM OWTR T0
INNER JOIN WTR1 T1
ON T0.[DocEntry] = T1.[DocEntry]
WHERE T1.DocEntry = @list_of_cols_val_tab_del
AND t1.WhsCode = 'ExRm'
AND t0.UserSign NOT IN ('29', '30', '67')
)
BEGIN
SET @error = 30
SET @error_message =
N'You are not authorized to Put the stock to this Warehouse'
END
END
Regards
Kennedy
Hi Ramesh,
Try below SP with some modification.
if (@object_type = '67') and (@transaction_type IN ( 'A','U'))
BEGIN
IF exists (select T1.DocEntry FROM OWTR T0
INNER JOIN WTR1 T1 ON T0.[DocEntry] = T1.[DocEntry]
where T1.DocEntry =@list_of_cols_val_tab_del and t1.WhsCode='ExRm' and t0.UserSign not in ('29','30','67'))
Begin
SET @error = 30
SET @error_message =N'You are not authorized to Put the stock to this Warehouse'
end
END
Hope this helps
--
--
Regards::::
Atul Chakraborty
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.