cancel
Showing results for 
Search instead for 
Did you mean: 

Lock activities in SAP Business One

Former Member
0 Kudos

The system allows Sap B1 delete activities. I am using the following command to stop it. I'm not successful.


SAP Business One 9 PL 16


Command in procedure SBO_SP_TransactionNotification


IF @object_type='33' AND (@transaction_type in ('D','C'))

BEGIN

  IF(

  Select

  count(*)

  from OCLG T0

  WHERE T0.parentId='28' AND T0.ClgCode=@list_of_cols_val_tab_del ) >0

  BEGIN

  select @error = '33'

  select @error_message = N'atividade amarrada a chamado de serviço!'

  END

END

Help Me?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

My problem was solved with the following code:

The Sap Business One did not allow me return messages however blocked the removal of the activity.

I could not apply a condition to lock. The system caught all processes to delete the document.

I solved my problem this process. Thank you all for your support.

IF @transaction_type='D' and @object_type='33'

Begin

  select @error ='33'

  select @error_message = N''

End

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ted,

What do you want to achieve? Your requirement is not very clear to me.

Please let me know, which object and what action you want to block.

May be then i can assist you.

Thanks & Regards

Ashish Ranjan

Former Member
0 Kudos

I would avoid the activities are removed from the system .

I am creating a rule and the activities that have this rule can not be removed .

The rule is:
If the activity is linked to a so-called services it can not be removed

frank_wang6
Active Contributor
0 Kudos

delete transaction is very special, because when SBO_SP_TransactionNotification is fired in SQL, the record actually has been removed, it is just before final commit.

So in this case, if u use T0.ClgCode=@list_of_cols_val_tab_del as the condition, it will always return nothing. I guess u will need to compare the value in history data to achieve this.

Frank