cancel
Showing results for 
Search instead for 
Did you mean: 

S.P

Former Member
0 Kudos
43

Hi

I want that no user except manager should be able to update Delivery & Return in Sales

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member206488
Active Contributor
0 Kudos

Hi,

Try this:

IF @transaction_type = N'U' AND (@Object_type = N'15')
BEGIN 
IF exists (SELECT T0.DocEntry   FROM ODLN T0 Inner JOIN OUSR T1 on T0.UserSign=T1.USERID
                   WHERE T0.UserSign<>1 AND T0.DocEntry  = @list_of_cols_val_tab_del)
BEGIN
Select @Error = -5002, @error_message = 'You are not authorized to update delivery Note !!'
END
END  

IF @transaction_type = N'U' AND (@Object_type = N'16')
BEGIN 
IF exists (SELECT T0.DocEntry   FROM ORDN T0 Inner JOIN OUSR T1 on T0.UserSign=T1.USERID
                   WHERE T0.UserSign<>1 AND T0.DocEntry  = @list_of_cols_val_tab_del)
BEGIN
Select @Error = -5003, @error_message = 'You are not authorized to update Return !!'
END
END 

check that user sign for manager is 1 . run select * from OUSR query and check USerId column for manager

Thanks,

Neetu