on 2021 Aug 09 1:21 PM
Hi All
To use Delete on transaction type I understand I need to use 'IF NOT EXISTS'
(I guess it's because the record will not exists after the delete..)
How can I block some users from the DELETE option?
This condition dose not works :"H.UserSign2 =O1.[USER_CODE]"
(I guess it's because the record will delete .. so there isn't any data who was the user ..)
And am I right abut this mention guess?
Kind regards,
Hila
---------------
This is my TN that blocks all user from DELETE OOPR
IF @transaction_type IN ('D') and @object_type='97'
begin IF NOT EXISTS
(SELECT H.OPPRID FROM OOPR AS H inner join OUSR O1 ON H.UserSign2 =O1.[USER_CODE] WHERE H.DocEntry=@list_of_cols_val_tab_del and O1.[USER_CODE] = N'user2' )
BEGIN
SET @error = 1
SET @error_message = N'u can not delete this DOC'
END END
Request clarification before answering.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.