cancel
Showing results for 
Search instead for 
Did you mean: 

Authorization for remove Bom

Former Member
0 Kudos

Hi All,

Is there a way using SP Stored Procedure to stop users from removing BOM ? But just someone can remove the BOM the others can't.

I have already try SBO_SP_TransactionNotification something like this:


DECLARE @User Nvarchar(8) 

IF @object_type='66'   
BEGIN

   SELECT @user=T1.USER_CODE 
      FROM OITT T0 LEFT JOIN OUSR T1 ON T0.UserSign2 = T1.USERID
     WHERE T0.Code=@list_of_cols_val_tab_del

  IF @user='manager'
   BEGIN

       IF @transaction_type='D'
        begin   
          set @error=1
          set @error_message=N'You can't delete the BOM'
        end

    END

END

But it can't work!!! How can I do?

Thanks in advance,

Vanessa

Accepted Solutions (1)

Accepted Solutions (1)

former_member196081
Active Contributor
0 Kudos

Hi,

Try below..



IF @object_type='66'  and  @transaction_type = 'D'
BEGIN
 
   if exist (SELECT T1.USER_CODE 
      FROM OITT T0 LEFT JOIN OUSR T1 ON T0.UserSign2 = T1.USERID
     WHERE T0.Code=@list_of_cols_val_tab_del and  T1.USER_CODE ='manager')
 
  
        begin   
          set @error=1
          set @error_message=N'You can't delete the BOM'
        end
 
    END
 


Regards

Deepak Tyagi

Edited by: Deepak Tyagi on May 24, 2011 7:41 AM

Former Member
0 Kudos

Hi,

Thanks for your advice ! I have already try it,but it still doesn't work.

I think when @transaction_type = '[D]elete',it won't update the field "OITT.UserSign2" ,only when 'Update' did.

Best Regards

Vanessa

former_member196081
Active Contributor
0 Kudos

Hi,

Did you check the general authorization.?

give the user only read only authorization for BOM...

Thanks

Deepak Tyagi

Former Member
0 Kudos

Hi,

Can't give the user read only authorization for BOM.User need to modiy.

Best Regards

Vanessa

Answers (0)