on 04-16-2012 11:07 AM
I want to create SP notification for non super user when they edit or change only BP name in BP master.
Hi,
Try:
IF @object_type = '2' and @transaction_type ='U'
Begin
If Exists (select T0.CardCode
FROM OCRD T0
INNER JOIN ACRD T1 ON T0.Cardcode = T1.CardCode
INNER JOIN OUSR T2 on T2.Internal_k=T0.Usersign2 AND T2.Superuser='N'
Where T0.CardCode=@list_of_cols_val_tab_del
and T1.Loginstanc=(select max(loginstanc) from ACRD where cardcode=T0.CardCode)
and T0.CardName!=T1.CardName)
Select @error =1,
@error_message = 'You are not allowed to change customer name!'
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.
Insert this in your SBO_SP_TransactionNotification stored procedure after the line
-- ADD YOUR CODE HERE
IF @object_type = '2' and @transaction_type ='U'
Begin
declare @li int
set @li=(select max(a.loginstanc) from ACRD a where a.cardcode=@list_of_cols_val_tab_del)
If (select T2.Superuser
FROM ACRD T0
INNER JOIN OCRD T1 ON T0.Cardcode = T1.CardCode
inner join OUSR T2 on T2.Internal_k=T1.Usersign2
Where T1.CardCode=@list_of_cols_val_tab_del
and T0.Loginstanc=@li
and T0.CardName!=T1.CardName)='N'
Select @error =1,
@error_message = 'You schould not change customer name !'
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 |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.