cancel
Showing results for 
Search instead for 
Did you mean: 

SP_Notification

Former Member
0 Kudos

I want to create SP notification for non super user when they edit or change only BP name in BP master.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (1)

Answers (1)

former_member204969
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Thanks it is working.

former_member204969
Active Contributor
0 Kudos

Then mark this as answered.

Former Member
0 Kudos

Hi,

Your code is correct but if i will update twice then it is not showing error.

It is updating the master.

former_member204969
Active Contributor
0 Kudos

What do you mean  by updating twice?

A superuser can update any times the name. But a non-super user can not.

Former Member
0 Kudos

If non-super user update twice the update button system will allowing him to change the customer name.

former_member204969
Active Contributor
0 Kudos

What is your system's version?

Under 8.81 pl09 it works correctly.